The men belonged to a group set up to fight HIV and Aids
The jailing in Senegal of nine gay men for eight years over "indecent conduct and unnatural acts" has been condemned by an international gay rights group.
Homosexual acts are illegal in Senegal but the International Gay and Lesbian Human Rights Commission (IGLHRC) told the BBC it was "shocked by the ruling".
The judge added three years to a five-year sentence, saying the men were also members of a criminal group.
Most of them belonged to an association set up to fight HIV and Aids.
"This is the first time that the Senegalese legal system has handed down such a harsh sentence against gays," said Issa Diop, one of the men's four defence lawyers.
Mr Diop said he would be appealing against the sentences.
The IGLHRC's Cary Alan Johnson said he was "deeply disturbed" by the case.
"There have been pretty consistent human rights violations… in Senegal," he told the BBC's Network Africa programme from Cape Town in South Africa.
"But the extremity of this sentence [and] the rapidness of the trial all really shocks us in a country which has been moving so positively towards rule of law and a progressive human rights regime."
The head of a gay rights organisation in Senegal told AFP news agency that the situation for gay people in the country was getting worse.
"Many gays are already fleeing to neighbouring countries because of our living conditions," he said, speaking on condition of anonymity.
Senegal is a predominantly Muslim country and gay men and women remain socially marginalised.
Mr Alan Johnson said Senegal was "schizophrenic" in its attitudes.
Religious attacks on gay and lesbian people were on the increase, he said.
While Senegal recently played host to a major conference on Aids and sexually transmitted diseases, where "the needs of men who have sex with men were prominently featured", he said.
"There's both a movement towards progressive and inclusive culture but at the same time very, very strong movements towards oppression, specifically towards sexuality," he added.
In February 2008, a magazine editor received death threats after publishing pictures claiming to depict a wedding ceremony between two men.
Several men were also arrested in connection with the publication but later released.