Uganda's constitutional court has struck down an anti-homosexuality law punishing gay sex with long jail sentences, on the basis that it was passed during a parliamentary session lacking a quorum.
People convicted under of "aggravated homosexuality” under the Anti-Homosexuality Act faced maximum punishments of life in prison and seven years for "aiding and abetting homosexuality".
Lesbians were also at risk of prosecution under the law for the first time and people found living together in same sex relationships faced life prison sentences.
A day after the law was passed the Ugandan tabloid Red Pepper published the names, and some photographs, of people they claim are homosexuals, alongside the front page headline: “EXPOSED!” on its front page.
The bill was signed in February to a wave of international criticism, and resulted in foreign aid being cut significantly.
Ten petitioners had challenged the anti-gay law after it was enacted in February on the grounds that it was illegally passed and that it violated certain rights guaranteed in Uganda's constitution.
Activists in the packed court room reportedly erupted in loud cheers when the court ruled the law is now "null and void".
The panel of five judges on the East African country's Constitutional Court said the speaker of parliament acted illegally when she allowed a vote on the measure despite at least three objections — including from the country's prime minister — over a lack of a quorum when the bill was passed.
"The speaker was obliged to ensure that there was a quorum," the court said in its ruling. "We come to the conclusion that she acted illegally."
Earlier in July, the Ugandan government released a statement insisting the law had been “misinterpreted” and was not homophobic. It said the law had only been introduced to prevent “open promotion of homosexuality”.
The Ugandan President Yoweri Museveni also defended the law in July, and said aid cuts had actually proved beneficial because they had “aroused” Ugandans to the need to “undertake serious work”.
Dr. Dimitrina Petrova, Executive Director of London-based the Equal Rights Trust, said the organisation was "delighted" at the outcome. The group has been lobbying the Ugandan Parliament and President Museveni on the Anti-Homosexuality Act and Uganda’s treatment of the LGBT community since 2009.
Dr. Dimitrina Petrova said: "As we celebrate this victory, it is important to remember that LGBT people in Uganda continue to suffer profound discrimination and gross inequality, not least through the criminalisation of same-sex sexual activity.
"We will continue to call for greater protection and respect for the rights of LGBT in Uganda, notwithstanding today's decision."