Uganda’s constitutional court has scrapped a controversial anti-pornography law whose provisions included a ban on wearing miniskirts in public, in a decision hailed by women’s rights campaigners on Tuesday.

The judgement, seen by AFP, said that the 2014 legislation, which had been dubbed the “anti-miniskirt law,” was “inconsistent with or in contravention of the constitution of the Republic of Uganda.”

“Sections… of the Anti-Pornography Act are hereby declared null and void,” Justice Frederick Egonda-Ntende said in Monday’s ruling, which also struck down the powers of a nine-member committee tasked with enforcing the law.

The legislation criminalised any activity deemed pornographic, from wearing short skirts to writing risque songs, and led to increased public harassment of women who wore clothing considered too revealing.

In 2014, Ugandan pop star Jemimah Kansiime was arrested for performing in a music video that showed her in her underwear. Currently, on trial, she faces up to 10 years in jail, although the future of the case is unclear because of the new ruling.

Women’s rights activists welcomed the verdict, which followed street protests by campaigners calling for the legislation to be dropped.

“This has been a bitter struggle and we are grateful (that) those who believe in the rights of women have emerged victors,” Lillian Drabo, one of the nine petitioners who challenged the law, told AFP Tuesday.

The petitioners said the legislation encouraged the harassment and mistreatment of women in public and denied them control over their bodies as well as access to public spaces.

The government’s lead counsel Imelda Adong told AFP they were “studying the ruling” and would respond in due course.

Uganda’s former minister for ethics and integrity, Simon Lokodo, was a longtime champion of the law, threatening to close a prestigious private school in 2016 for stocking copies of a British children’s book which was deemed too s_xual.

In the past, Lokodo ordered police to arrest men who have sex with prostitutes and described a popular local television dating show as prostitution.

Local media reported that he also confronted Proscovia Alengot Oromait, then Uganda’s youngest MP, when she walked into parliament in a short skirt.