Washington • Congress passed a budget bill Thursday, averting a looming government closure but giving a smaller amount for President Donald Trump’s border wall even as the president warned he would declare a national emergency at America’s southern border and tap other funds to put up a physical barrier.

The $331 billion bill, passed overwhelmingly in both chambers, funds several government departments through Sept. 30, ending fears of another shutdown only weeks after the longest closure in U.S. history – 35 days – that furloughed or forced 800,000 workers to stay on the job without pay.

The president's plan to declare an emergency, which is legally dubious, drew criticism from both sides of the aisle and immediate threats of litigation.

With the exception of Sen. Mike Lee and Rep. John Curtis, Utah’s members of Congress supported the bill.

“This was a bad spending bill for many reasons, most egregiously because it incentivizes drug cartels to traffic minors across our southern border,” Lee, a Utah Republican, said in a statement.

Lee declined to comment on the potential of a national emergency declaration until he sees the details.

But the prospect of such an order from Trump, one that likely would take money from existing disaster funds – including those for the hurricane disaster in Puerto Rico and wildfire damage in California – has raised concerns with Congress. The Democratic-led House is likely to vote to overturn Trump's action, forcing the GOP-controlled Senate to take a vote on the declaration.

Sen. Mitt Romney, a freshman Republican from Utah, also said he'll reserve judgement on the emergency action, though he raised a red flag about the possibility.

“I will reserve judgment on any potential executive action by the president until I am able to fully evaluate it, but as I’ve said, I do not believe declaring a national emergency is the right approach,” Romney said in a statement. “I would also expect the president to stay within statutory and constitutional limits.”

Romney supported the budget bill, though he wasn’t necessarily happy about it.

“While this bill is far from perfect, it includes critical funding for border security and immigration enforcement, and prevents another harmful government shutdown,” Romney said. “I am glad the Senate was able to conclude this unfinished business from last year.”

Rep. Rob Bishop, R-Utah, voted for the bill because he didn’t want another shutdown, though he wasn’t a fan of the bill.

“There is a crisis on the southern border. This compromise bill does not come close to solving that problem, but I don’t want another government shutdown, so I have voted yes,” Bishop said, blaming Democrats for “pure political spite” in the negotiations over border security.

That said, Bishop doesn’t think a national emergency declaration is a good idea.

“The president should not declare a national emergency,” Bishop said. “He needn’t even be in this position if congress would have done its job and funded both the government and border security. This is a failure of Congress to act.”

The Senate had agreed – by voice vote – to a deal in December to fund the government, erasing any chance of a shutdown, but the then-GOP-led House refused to take it up after Trump, spurned on by conservative commentators, said the $1.6 billion for border security wasn’t enough. He demanded $5.7 billion to build a wall, a campaign promise he had repeatedly uttered and assured voters Mexico would ultimately pay for.

The new deal offers $1.375 billion to build 55 miles of fencing along the border in Texas – a fraction of the 234 miles of walling that Trump wanted.

Utah's lone Democrat in Congress, Rep. Ben McAdams, also said the bill wasn't perfect but it would halt another unnecessary shutdown.

"Government shutdowns are terrible for workers, our economy and our national security,” McAdams said in a statement. “The president should never again harm all three by forcing a government shutdown to get his way. Now we must continue working together on immigration reform, including permanent protection for our Dreamers.”

Dreamers is a reference to immigrants brought to the United States as children; President Barack Obama had used executive authority to protect their legal status in the U.S., an action Trump reversed.

“Fixing our broken immigration system is the true, long-term solution to border protection, economic security and a humane, compassionate response to people seeking safety and a better life for themselves and their families in America," McAdams said.

The freshman Democrat said he opposes the emergency declaration and that, like Romney said, it should only be used for “extreme and exigent circumstances.”

Rep. John Curtis, R-Utah, said he believes it is “critical” to secure the border but he is not on board with Trump declaring an emergency.

“I will evaluate a possible emergency declaration if it is proposed, but I worry about the harmful precedent that approach can set and whether or not it could be legally justified,” Curtis said. “Congress needs to solve the difficult problems facing our borders and broken immigration system – we cannot rely on executive actions to get our job done.”

Rep. Chris Stewart, R-Utah, warned that Trump may be making a mistake with calling a national emergency because future Democratic presidents could try the same tactic to tackle gun control or climate change.