Uganda’s Constitutional Court invalidated the country’s controversial anti-gay law Friday, finding that the legislature violated its own procedural rules when passing the bill earlier this year.

The five-judge panel found that the speaker of the parliament did not have a quorum—sufficient members present—to vote on the bill. At least three objections were made over a lack of quorum when the bill was passed, the Associated Press reports.

“The speaker was obliged to ensure that there was quorum,” the court wrote in its decision. “We come to the conclusion that she acted illegally.”

The decision vacates a controversial law that imposes potentially lifelong prison sentences for having homosexual intercourse, as well as lengthy sentences for “attempted homosexuality” and “promotion of homosexuality.” The law enjoyed widespread support in Uganda but was condemned by Western countries and civil rights groups, many of whom have cheered the court’s decision.

An attorney for the state said it hasn’t yet been decided whether the decision will be appealed to the country’s Supreme Court.