Two gay men were arrested after neighbors told police they were living together in Dakar, the capital of Senegal, in West Africa, according to the Associated Press.
After the two men admitted to having sex with each other in court last Friday, Judge Racky Deme sentenced them to six months under Senegal's criminal code, which could lead to sentences of up to five years and fines of up to $3,000 for committing "an improper or unnatural act with a person of the same sex," the AP reports.
Despite the sentencing, Senegalese President Macky Sall insists that gay people are only prosecuted if they break the law.
Last June, President Barack Obama urged African leaders to treat the LGBT community equally during a press conference at the grand presidential palace in Dakar.
"I want the African people just to hear what I believe, and that is that every country, every group of people, every religion have different customs, different traditions," he said. "And when it comes to people's personal views and their religious faith, etc., I think we have to respect the diversity of views that are there. But when it comes to how the state treats people, how the law treats people, I believe that everybody has to be treated equally. I don't believe in discrimination of any sort."
Sall responded by arguing that Senegal is "a very tolerant country which does not discriminate," but that they are "still not ready to decriminalize homosexuality."
"[W]e have respect for the rights of homosexuals — but for the time being, we are still not ready to change the law," he said.
Similar arrests have been common in Senegal since 2008. Five suspected lesbians were arrested in the country in November during a birthday party in Dakar's Yoff district, which has been described in the press as a meeting point for gays and lesbians, according to Ndeye Kebe, president of the activist group Women's Smile.
Thirty-eight African countries outlaw consensual same-sex acts.