DAKAR, Senegal -- A well-known Senegalese journalist was sentenced Friday to six months in prison for acts of homosexuality, which is illegal in this West African country.

Tamsir Jupiter Ndiaye, who had previous homosexuality convictions, was arrested in June after a young man accused him of attempted rape. Chased by an angry mob, he took refuge in a Dakar police station.

The magazine columnist was sentenced in 2012 to 4 years in prison for acts of homosexuality, illegal possession of arms and battery. The sentence was later reduced to 2 years and he was paroled in 2013.

Homosexual acts are illegal in Senegal and punishable by up to five years prison and fines of up to $2,500.

A Human Rights Watch report from 2010 reported widespread abuse of gay men, including torture and ill-treatment, particularly by police.

Homosexuality is a criminal offense in more than two-thirds of African countries.