Uganda's constitutional court on Friday declared the nation's draconian anti-gay legislation null on procedural grounds. Rights activists had argued that the law is invalid because it was passed without garnering the minimum number of votes required by the country's parliament.

Andrew M. Mwenda, a Ugandan journalist, who was reportedly one of 10 activists to file the petition, tweeted from the courtroom:

According to Uganda’s anti-gay law, harsh punishments like life imprisonment would be handed out to people convicted of engaging in gay sex. It had also prescribed lengthy jail terms for people convicted of crimes such as “attempted homosexuality” and “promotion of homosexuality.”

Despite the legislation having wide support in Uganda, it was vehemently condemned by Western countries and human rights groups, who described it as draconian. The U.S. had called for the law to be repealed and also withheld funding of some Ugandan institutions accused of being involved in human rights abuses.

The anti-gay law was passed in December 2013 and was enacted in February this year by Ugandan President Yoweri Museveni, who said he wanted to discourage Western groups from promoting homosexuality among African children.