WASHINGTON — The state of New Jersey joined efforts Thursday to overturn Trump administration rules that could allow nonprofit groups spending money on U.S. elections to hide contributions from foreign sources.

Such social welfare groups have spent millions of dollars to elect favored candidates without the public knowing where their funding is coming from. In the last election, so-called dark money organizations spent $148 million, according to the Center for Responsive Politics, a Washington-based research group.

But the organizations, incorporated under Section 501(c)(4) of the U.S. tax code, had been required to disclose their major donors to the Internal Revenue Service and many states, including New Jersey.

Now they won’t have to.

“Not only has the IRS made it easier for organizations to hide the sources of their money, it has done so behind closed doors, without seeking public input,” said state Attorney General Gurbir Grewal, the top law enforcement official in Democratic Gov. Phil Murphy’s administration.

It’s the latest legal attack on the Trump administration by Grewal, who in the last month sued to overturn President Donald Trump’s emergency declaration to let him build a southern border wall, stop offshore drilling off the Jersey Shore, reject the Republican federal tax law’s cap on deducting state and local taxes, and block a ban on allowing transgender individuals to serve in the U.S. armed services.

The lawsuit contends that the IRS decision will make it harder for the Charities Registration Section of the state Division of Consumer Affairs to do its job in regulating the 32,000 charities registered with the state, including hundreds of 501(c)(4) groups.

Those organizations now are required to submit their entire IRS Form 990 filings, including their donors. The state is developing its own rules to require such information, even if the federal government doesn’t want it, but the Division of Consumer Affairs said that will cost money, the New Jersey attorney general’s office said.

“This is yet another instance of the federal government damaging states’ enforcement authority without even asking us first,” Grewal said.

The U.S. Treasury Department announcement was made last July. It does not affect charitable organizations.

The new rule came shortly after the U.S. Justice Department indicted a Russian national, Maria Butina, on charges that she tried to influence U.S. politics through the National Rifle Association, a nonprofit that would affected by the new rules.

That drew this rebuke from U.S. Sen. Ron Wyden, D-Ore., the top Democrat on the tax-writing Senate Finance Committee.

🚨 Trump’s @USTreasury has made it EASIER for anonymous foreign donors to funnel dark money into nonprofits THE SAME DAY a Russian national linked to the @NRA was arrested for trying to influence our elections. — Ron Wyden (@RonWyden) July 17, 2018

“Law enforcement agencies have lost a very important tool to enforce the ban on foreign money in elections,” said Paul Seamus Ryan, vice president for policy and litigation at Common Cause, an advocacy group that supports stronger campaign finance laws.

The U.S. House Democratic majority passed legislation earlier this month to require all groups spending money on political races to identify their major contributors.

Jonathan D. Salant may be reached at jsalant@njadvancemedia.com. Follow him on Twitter @JDSalant or on Facebook. Find NJ.com Politics on Facebook.

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

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