Kampala - A Ugandan court has invalidated an anti-gay bill signed into law earlier this year, saying it was illegally passed and is therefore unconstitutional.
The panel of five judges on the East African country's Constitutional Court said the speaker of parliament acted illegally when she went ahead to allow a vote on the measure despite at least three objections over lack of a quorum.
The ruling was made before a courtroom packed with Ugandans opposing or supporting the measure. Activists erupted in loud cheers after the court ruled the law is now "null and void".
The anti-gay law provided jail terms of up to life for those convicted of engaging in gay sex.
It also allowed lengthy jails terms for those convicted of the offenses of "attempted homosexuality" as well as "promotion of homosexuality".
Although the legislation has wide support in Uganda, it has been condemned in the West and rights groups have described it as draconian.
The US, which wants the law repealed, has withheld or redirected funding to some Ugandan institutions accused of involvement in rights abuses.