Story highlights The men were sentenced in November 2011

Group: The judge stated they were homosexuals because they wore women's clothes and drank Bailey's Irish Cream

In 2011, a court sentenced both to five years in prison

Homosexuality is illegal in Cameroon

A Cameroon appeals court has acquitted two men found guilty of homosexuality because they wore women's clothes and ordered a cream-based liqueur, according to rights groups.

Jonas Kimie and Franky Ndome were arrested outside a nightclub and sentenced to five years in prison in November 2011

"The acquittal of two Cameroonian men jailed for looking gay because they wore women's clothes exposes the systematic discrimination against perceived homosexuals in the country," Amnesty International said in a statement.

The conviction was based on stereotypes because authorities never saw them engage in homosexual acts, according to their lawyer.

"The judge who originally sentenced them had stated that the way they dressed, the way they spoke, and the fact that they drank Bailey's Irish Cream proved they were gay," their lawyer, Alice N'Kom, told global gay rights group All Out, which launched a petition demanding the men's release.

JUST WATCHED Proposed laws target gays in Uganda Replay More Videos ... MUST WATCH Proposed laws target gays in Uganda 02:55

The court overturned the conviction Monday, but it was unclear whether they have left prison.

Homosexuality is illegal in Cameroon, where sodomy laws were introduced during colonialism. Sentences for homosexual acts vary between six months to five years.

Rights groups applauded the ruling, but called on the nation to free others imprisoned under anti-gay laws.

The university student was arrested in 2011 after the man who received the message tipped off authorities.

Authorities in the west African nation were not immediately available for comment.

A series of countries have criminalized homosexuality, but prosecutions are rare.