Authorities in 20 states, including New Jersey, are asking a federal judge to immediately block President Donald Trump’s diversion of federal money to fund a border wall.

In court papers filed late Thursday, a coalition of attorneys general in Democratic-leaning states argued the Republican president’s plan deprives their offices of federal dollars meant for law enforcement purposes and threatens environmental resources along the border.

The states first filed suit in February after Trump declaring illegal crossings at the U.S. border with Mexico a national emergency, using executive power to circumvent Congress and free up money to fortify the border. The Trump administration later freed up money for wall construction by tapping into federal asset forfeiture funds, which are typically shared with state and local law enforcement.

The states are seeking a preliminary injunction to block the move while their arguments are heard in court.

In a Twitter post Friday morning, New Jersey Attorney General Gurbir Grewal said Trump had “no right to take taxpayer money” the Garden State relies upon and use it for an “unnecessary border wall.”

We’ve said it from the start: the President has no right to take taxpayer money that NJ counts on & spend it on an unnecessary border wall. Today, we’re seeking an immediate order to stop those efforts. I’m proud to stand up for NJ residents – including our immigrant communities. pic.twitter.com/4MceT5r738 — AG Gurbir Grewal (@NewJerseyOAG) April 5, 2019

Trump administration officials did not immediately respond to a message seeking comment on the suit.

The move comes as Trump is visiting new border fence construction during a trip to California, the lead plaintiff state in the lawsuit.

Thursday’s filing argues that in addition to depriving states of federal money they are entitled to, the president’s end-run around Congress was an illegal act.

“Congress unequivocally rejected the president’s requested appropriation for a border wall, only for the president to then order the diversion of federal funds from other sources toward the very project that Congress rejected,” the states argued in court papers.

Trump has defended his use of executive power, though he acknowledged when he announced the move that legal challenges were likely.

“We’re going to confront the national security crisis on our southern border, and we’re going to do it one way or the other,” he said in the February address.

The suit by the state attorneys general is not the only legal challenge Trump faces. The U.S. House of Representatives is also preparing a suit, House Speaker Nancy Pelosi said this week.

Material from the Associated Press was used in this report.

S.P. Sullivan may be reached at ssullivan@njadvancemedia.com. Follow him on Twitter.

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

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