Minnesota joined 15 states Monday in asking a California federal judge to halt President Donald Trump’s national emergency declaration, arguing that diverting funds to build a border wall would hurt the state’s National Guard and frustrate counter-narcotic efforts.

Minnesota Attorney General Keith Ellison said Monday that if Trump’s Friday declaration were to move forward, federal money designated for the Minnesota National Guard would be at risk, challenging efforts to intercept drug trafficking and respond to natural disasters.

“It is also a clear overreach of the power of the executive branch that hurts the people of Minnesota and every state by manufacturing a crisis — at a time when unauthorized border-crossings are at a 20-year low — that endangers the balance of powers at the root of our Constitution,” Ellison said after the lawsuit was filed by California Attorney General Xavier Becerra in the Northern District of California.

The legal challenge was widely expected — including by the president — soon after Trump’s declaration. Ellison posted multiple tweets signaling his intent to join the litigation, including retweeting news reports that such a move was in the works. On Saturday, after a Minnesota immigration lawyer tweeted to Ellison urging him to join Becerra in filing suit, the first-term attorney general replied “Brilliant idea!”

Trump is seeking to redirect billions of dollars to build a wall that was a central campaign promise in 2016 and for which he has previously failed to negotiate funding. Trump declared the emergency after signing a spending package that included $1.375 billion for fencing in some areas along the border. A previous impasse over the wall produced a record 35-day government shutdown.

“We will have a national emergency, and we will then be sued and they will sue us in the Ninth Circuit, even though it shouldn’t be there and we’ll possibly get a bad ruling, and then we’ll get another bad ruling and then we’ll end up at the Supreme Court, and hopefully we’ll get a fair shake,” Trump said, referring to the federal appeals court that rejected his 2017 travel ban before it was later upheld by the Supreme Court.

The lawsuit filed Monday, which is asking that the court immediately stop what the states describe as a “vanity project” from starting, argues that the 16 states “collectively stand to lose millions” in federal funding used by National Guard units to curb drug trafficking and annual funding awarded to law enforcement programs through the Treasury Forfeiture Fund.

The states cite federal government figures to argue that no crisis exists at the border: Customs and Border Protection numbers show unlawful entries are near a 45-year low, and the State Department acknowledged a “lack of credible evidence” that terrorists are using the border to sneak into the U.S.

Becerra has led dozens of suits against the Trump administration since taking office in 2017. Ellison recently joined his former U.S. House progressive caucus ally in suing to block the government from adding a citizenship question to the 2020 Census and last week joined 21 other attorneys general in an amicus brief asking the Ninth Circuit to uphold a lower-court ruling that blocked Homeland Security from terminating Temporary Protected Status for people from Haiti, El Salvador, Nicaragua and Sudan.

“When the president or the federal government harms the people of Minnesota, I’ll use the power of my office to protect Minnesotans,” Ellison said Monday.