DONALD Trump has been accused of planning a “gross abuse of power” after he vowed to declare a national emergency to siphon billions from other federal coffers for his Mexican border wall.

Beforehand, Congress approved a border security compromise to avert a second painful government shutdown. But funding in the bill for border barriers, about $1.4 billion (£1 billion), is far below the $5.7bn (£4.5bn) Trump insisted he needed to build a wall along the Mexican boundary and would finance just a quarter of the 200-plus miles he wanted.

The White House said he would sign the legislation but act on his own to get the rest, a move that prompted immediate condemnation from Democrats and threats of lawsuits from states and others who might lose federal money or said Trump was abusing his authority.

The uproar over what Trump would do next cast an uncertain shadow over what had been a rare display of bipartisanship in Congress to address the grinding battle between the White House and politicians over border security.

The Senate passed the legislation 83-16, with both parties solidly on board. The House followed with a 300-128 tally, with Trump's signature planned on Friday.

Both margins were above the two-thirds majorities needed to override presidential vetoes.

Politicians exuded relief that the agreement had averted a fresh closure of federal agencies just three weeks after a record-setting 35-day partial shutdown that drew an unambiguous thumbs-down from the public.

But in announcing that Trump would sign the accord, White House Press Secretary Sarah Sanders also said he would take "other executive action, including a national emergency".

In an unusual joint statement, House Speaker Nancy Pelosi and Senate Minority Leader Chuck Schumer said such a declaration would be "a lawless act, a gross abuse of the power of the presidency and a desperate attempt to distract" from Trump's failure to force Mexico to pay for the wall.

Pelosi and Schumer also said: "Congress will defend our constitutional authorities".

They declined to say whether that meant lawsuits or votes on resolutions to prevent Trump from unilaterally shifting money to wall-building, with aides saying they would wait to see what he does.

Despite widespread opposition in Congress to proclaiming an emergency, including by some Republicans, Trump is under pressure to act unilaterally to soothe his conservative base and avoid looking like he has surrendered in his wall battle.

The abrupt announcement of Trump's plans came late in an afternoon of rumblings that the volatile president, who strongly hinted he would sign the agreement but never definitively, was shifting towards rejecting it.

Moments before Sanders spoke at the White House, Senate majority leader Mitch McConnell took to the Senate floor to announce Trump's decisions to sign the bill and declare an emergency, despite rates of illegal immigration into the US dropping in recent months.

White House aides and congressional Republicans have said that besides an emergency, Trump might assert other authorities that could conceivably put him within reach of billions of dollars. The money could come from funds targeted for military construction, disaster relief and counter-drug efforts.

Trump sparked the last shutdown before Christmas after Democrats snubbed his $5.7bn demand for the wall.

With polls showing the public blamed him and Republican politicians, Trump folded on January 25 without getting any of the wall funds.

His capitulation was a political fiasco for Republicans and handed Pelosi a victory less than a month after Democrats took over the House and confronted Trump with a formidable rival for power.