The court found that the legislation had been passed by Parliament in December without the necessary quorum before its enactment in February, and the law was therefore "null and void."
It is unclear whether the Parliament will attempt to reintroduce similar legislation.
The anti-homosexuality act criminalized both homosexuality and outreach to gays and lesbians, and imposed harsh penalties if violated. Those found guilty of "aggravated homosexuality" faced life in prison, and those "Aiding and abetting homosexuality" were also subject to imprisonment -- a provision that concerned rights groups, as well as LGBT support service providers.
Ten petitioners had challenged the law, and several countries were outspoken in their condemnation of the anti-homosexuality law.
Denmark, Norway, Sweden and the Netherlands severed ties with Uganda because of the law, and the U.S. imposed economic sanctions that included cutting funds to ongoing programs involving Uganda's police force and public health ministry, canceling a military aviation exercise, and a ban on entry to the United States of Ugandans involved in human rights abuses against gay people.