U.S. President Donald Trump said Thursday it's likely he would declare a national emergency to secure funds for his long-sought wall along the U.S. southern border if an agreement with Democrats in Congress to provide the money isn't reached.

"I have the absolute right to declare a national emergency. I'm not prepared to do that yet, but if I have to I will," Trump said.

"I may do it. If this doesn't work out, probably I will do it. I would almost say definitely."

Trump spoke to reporters at the White House as he prepared to depart to visit the Texas border town of McAllen on the 20th day of a partial government shutdown. He repeated his contention that he had the right to declare a national emergency over immigration.

Trump says he'd declare an emergency over the border if he has to:

The U.S. president says that declaring a national emergency over the border is well within his powers and he'll declare one if he has to in order to build his wall. 1:28

In Texas later Thursday afternoon, Trump held a roundtable discussion with representatives from ICE (U.S. Immigration and Customs Enforcement) and the U.S. border patrol agency, as well as families of people who say their loved ones were hurt or killed by illegal immigrants.

He promised again that the wall — what he now refers to as a "powerful steel barrier" — will be built and that Mexico will effectively pay for it as a result of better terms for the U.S. under the new U.S.-Mexico-Canada trade deal.

Mexico 'indirectly' paying for wall, Trump says

Trump's plan to build a wall at the southern border — and have Mexico pay for it — was a central promise of his 2016 presidential campaign. On Thursday, Trump insisted that he never said Mexico would "write out a cheque" for the wall, but that the new trilateral deal that includes Canada meant Mexico would "indirectly" pay for it.

The new trade deal, in fact, contains no specific provisions or language around funding for a wall or a barrier, and trade deals do not generate federal revenue. The deal has also not been ratified, so is not yet in force.

Trump says Mexico is 'indirectly' paying for the wall:

The U.S. president insists he never said Mexico would 'write out a cheque' for the wall and that Mexico is paying indirectly through the new trade deal. 1:02

Trump has held out for $5.7 billion US in partial wall funding in talks with congressional leaders, but Democrats have held steadfast in their opposition to providing any money for a border wall.

The dispute led to a shutdown of about a quarter of U.S. federal agencies when funding ran dry late last year.

If Trump were to declare an emergency in an effort to redirect funds Congress has approved for other purposes, it likely would lead to quick challenges in the courts.

Trump says undocumented immigrants and illegal drugs are streaming across the border from Mexico, despite statistics that show illegal immigration there is at a 20-year low and that many drug shipments likely are smuggled through legal ports of entry.

Trump said last month he would be "proud" to shut the government down over the issue but he has since tried to blame the Democrats.

He also blamed the Democrats in a tweet Thursday afternoon for his decision not to attend the World Economic Forum in Davos, Switzerland. He was scheduled to leave Jan. 21.

Because of the Democrats intransigence on Border Security and the great importance of Safety for our Nation, I am respectfully cancelling my very important trip to Davos, Switzerland for the World Economic Forum. My warmest regards and apologies to the <a href="https://twitter.com/wef?ref_src=twsrc%5Etfw">@WEF</a>! —@realDonaldTrump

Democrats accuse Trump of using fear tactics and spreading misinformation about the border situation in order to fulfil a 2016 campaign promise as he looks toward his race for re-election in 2020.

Trump disparaged the top congressional Democrats, House Speaker Nancy Pelosi and Senate Democratic leader Chuck Schumer, by saying he finds China "to be far more honourable" and "easier to deal with."

Trump says dealing with China is easier than the Democrats:

The U.S. president tells reporters that dealing with China is easier than negotiating with Democrats including Chuck Schumer and Nancy Pelosi. 0:22

While this is Trump's first visit to the border in Texas as president, his administration's immigration crackdown has been felt there for months.

Hundreds of the more than 2,400 children separated from their parents last summer were detained in cages at a Border Patrol facility in McAllen. Three "tender-age" facilities for the youngest children were opened in this region.

The president also ordered soldiers to the border in response to a wave of migrant caravans before the November election. Those troops had a heavy presence in the Rio Grande Valley, though they have since quietly left. A spokesperson for the border security mission said they closed their base camp along the border on Dec. 22.

A U.S. border patrol officer makes his rounds near central El Paso, Texas. (Paul Ratje/AFP/Getty Images)

But Trump's border wall will last beyond his administration. Building in the region is a top priority for the Department of Homeland Security because it's the busiest area for illegal border crossings. More than 23,000 parents and children were caught illegally crossing the border in the Rio Grande Valley in November — more than triple the number from a year earlier.

With part of the $1.6 billion Congress approved in March, U.S. Customs and Border Protection announced it would build 40 kilometres of wall along the flood-control levee in Hidalgo County, which runs well north of the Rio Grande.

Congress did not allow construction of any of Trump's wall prototypes. But the administration's plans call for a concrete wall to the height of the existing levee, with 5.5 metres steel posts on top. CBP wants to clear 45 metres in front of any new construction for an "enforcement zone" of access roads, cameras, and lighting.