Image copyright Getty Images

US markets closed lower on Wednesday, sliding back after President Donald Trump gave a fiery speech suggesting more political drama lies ahead.

At a rally in Arizona on Tuesday, Mr Trump said he would be willing to shut down the government if Congress resists funding a border wall.

He also said he was still considering terminating the North American Free Trade Agreement.

The Dow Jones Industrial Average fell 0.4% to 21,812 points.

The wider S&P 500 index fell 0.35% to 2,444 points, while the Nasdaq fell 0.3% to 6,278 points.

Consumer stocks led the losses, while real estate and energy firms enjoyed a bounce.

The losses came after a broad market rise on Tuesday, when share prices regained some of the ground lost in recent weeks.

After share prices touched record highs earlier this summer, investors have been cautious, rattled by rising tension with North Korea and domestic controversy surrounding the President.

Terry Sandven, chief equity strategist for US Bancorp Wealth Management, says he expects stock gains to remain in check in coming weeks, part of a regular seasonal dip.

Investors are also concerned about the prospect of political fights next month, when Congress will be considering a budget proposal and are likely to be asked to raise the debt limit.

"Conditions seem ripe for equities to hover in 'pause mode', with risks seemingly on the rise," he wrote. "Political uncertainty remains ongoing, valuations are full and technical trendlines are showing signs of modest deterioration."

In 2013, a fight over the debt limit led to a government shutdown that disrupted the US economy, particularly in states closely tied to the federal government and its contractors.

Economists say scrapping Nafta would also hurt business in the US, which counts Canada and Mexico among its biggest trade partners.

Retailer Lowe's fell 3.7% after reporting lower than expected growth in the quarter.

United Technologies bounced 1.1% after a report suggested that it may be the target of activist investors.