After months of arguments and legal maneuvering, a controversial law forcing the identification of once-secret donors to political organizations that raise millions to influence elections and policy in New Jersey is now officially dead.

U.S. District Judge Brian Martinotti on Wednesday granted a permanent injunction against the “dark money” law after the state Attorney General’s Office came to an agreement with groups that sued to overturn it. That means the state cannot enforce the law (S1500).

The law, which Gov. Phil Murphy signed last June, required that certain groups that support candidates or influence policy in New Jersey to disclose donors who give them more than $10,000 a year.

Supporters said the law was designed to shed more light on the donors who give secret donations — often known as “dark money” — to groups that have an effect on taxpayer-funded state government.

But critics said the law curbs free speech because it would keep people who don’t want their names to become public from getting involved in politics and policy.

Multiple groups filed lawsuits seeking to overturn the law. That included the conservative group Americans for Prosperity as well as more liberal groups, the American Civil Liberties Union and the Illinois Opportunity Project, a nonprofit that seeks to educate the public about policy.

The Liberty Justice Center, a nonprofit that aims to protect peoples’ First Amendment rights, called Wednesday’s development a major victory for free speech.

“Adopted under the guise of transparency, these laws are designed to allow opponents of advocacy groups to intimidate and harass the organizations’ supporters," said Patrick Hughes, the group’s president and co-founder.

“All Americans should be free to support causes they believe in without an invasion into their privacy through excessive government reporting requirements or retribution from their opponents.”

Jeanne LoCicero, the New Jersey legal director for the ACLU, also praised the death of the measure.

“All nonprofits should be able to communicate about issues of public concern without fear of being subject to invasive disclosure rules," LoCicero said.

Both Murphy’s office and the state Attorney General’s Office declined to comment.

Martinotti issued a preliminary injunction in October blocking the state from enforcing the law until there was a ruling in the case.

The judge wrote in his opinion then that the “loss of First Amendment freedoms, for even minimal periods of time, unquestionably constitutes irreparable injury."

In his order Wednesday, Martinotti said this does not prevent the state Legislature or the state Election Law Enforcement Commission from enacting future legislation or regulations related to the law.

The state lawmakers who sponsored the law, state Sen. Troy Singleton, D-Burlington, and state Assemblyman Andrew Zwicker, D-Somerset, said in a statement last week that they have already started working with legislative leaders “on the next step.”

“We believe there is a clear path forward,” the legislators said. “With the presidential and congressional elections later this year, we expect tens of millions of ‘dark money’ dollars to be spent in an attempt to influence the outcomes. We will continue to fight to ensure that those organizations that accept anonymous large donations are forced to disclose their sources.”

The law gained attention because of an ongoing feud between Murphy and state Senate President Stephen Sweeney, a fellow Democrat with whom the governor often clashes.

The Democratic-controlled Legislature fast-tracked the bill last year, and Murphy initially conditionally vetoed it. He said the measure would force grassroots and progressive groups to reveal their contributors and make it harder for them to raise money.

But Murphy signed the bill in June after lawmakers threatened to override his veto — which hasn’t happened to a New Jersey governor in 22 years.

Brent Johnson may be reached at bjohnson@njadvancemedia.com. Follow him on Twitter @johnsb01.

Ted Sherman may be reached at tsherman@njadvancemedia.com. Follow him on Twitter @TedShermanSL. Facebook: @TedSherman.reporter.

Have a tip? Tell us. nj.com/tips

Get the latest updates right in your inbox. Subscribe to NJ.com’s newsletters.