A federal judge this week struck down key provisions of New York’s lobbying law that would have required 501(c)(3) and 501(c)(4) nonprofit groups to publicly disclose information about their donors.

New York’s lobbying law was passed by state legislators in 2016. Governor Andrew Cuomo’s administration said the law was needed to address political corruption after the 2010 Citizens United ruling by the Supreme Court which allows unlimited political spending by outside groups.

The law was quickly challenged by several interest groups and enforcement of the lobbying disclosure provisions was temporarily blocked during the two-and-a-half year legal battle. Federal Judge Denise Cote from the Southern District of New York ruled Sept. 30 that the state law was overly broad and infringed on free speech rights.

“The First Amendment rights to publicly discuss and advocate on issues of public interest, and to do so anonymously, have long been recognized,” Cote wrote. The New York lobbying law “sweeps far more broadly than any disclosure law that has survived judicial scrutiny.”

The Cuomo administration is considering an appeal of the court’s ruling. “Everyone preaches transparency until transparency shows up on their front door,” said Cuomo spokesman Rich Azzopardi. “We are reviewing this decision and considering next steps, including appeal.”