U.S. President Donald Trump has renewed a threat to declare a national emergency to fund the construction of a wall on the Mexican border.

Media reports say a row with Democrats over funding the wall has left the government partially shut down for 20 days, leaving some 800,000 federal employees unpaid.

Mr. Trump says the wall, a key campaign pledge, is needed to tackle a security crisis of illegal immigration.

The Democrats say the wall is an "immorality" and a waste of taxpayers' money.

Mr. Trump issued the threat on a visit on Thursday to a border patrol station in McAllen, in the Rio Grande Valley of Texas.

He said that if Congress did not approve funding for the wall, he would declare a national emergency to bypass lawmakers.  "I have the absolute right to declare a national emergency," he said.

According to the BBC, Mr. Trump would have the right to undertake such a construction project in times of war and national emergency, usually allocating funds from the Department of Defense.

But bypassing Congress would be hugely controversial, sparking allegations of the overuse of executive powers and it would almost certainly face huge legal challenges.

Some US media reports suggest the White House is considering diverting some of the $13.9 billion allocated last year by Congress for disaster relief in such areas as Puerto Rico, Texas and California to pay for the wall.

NBC News reported on Thursday that Mr. Trump had been briefed on such a plan but the White House denied it.

The White House has reportedly begun laying the groundwork for a declaration of national emergency to build President Trump’s border wall.  The administration is eyeing unused money in the Army Corps of Engineers budget, specifically a disaster spending bill passed by Congress last year that includes $13.9 billion that has been allocated but not actually spent for civil works projects, two people with knowledge of the developments said Thursday, according to Press Herald.

Analysts say the national emergency move would provide political cover to reopen government while allowing Mr. Trump to argue he has done all he can to fulfill his campaign promise.