US markets saw a choppy session, as investors digested mixed economic data and the ongoing US-China trade war before a holiday weekend.

For the first time since May, the main US indexes also closed out the month in the red, after bruising weeks when trade war and economic fears eroded gains won in June and July.

The Dow Jones moved into positive territory in the final moments of the trading day, closing up 0.2 percent at 26,403. But the S&P 500 ended flat at 2,926.46, while the Nasdaq fell 0.1 percent to 7,962.

Tom Cahill of Ventura Wealth Management said stocks had fallen from their session highs as traders exercised caution or cashed in after the gains scored during the week.

“It’s profit taking after a pretty nice few days,” he said. “If you’re a trader and have pretty good profits, it would be a good time to take some off the table.”

He also noted that the S&P 500 tended to “run out of steam” as it approached the 2,940 mark.

US markets will be closed Monday for the Labour Day holiday, which falls a day after President Donald Trump is due to jack up import duties on more than US$100 billion in Chinese imports, escalating his trade war with China.

“There’s a little bit of caution here,” Cahill said.

Wall Street got a dose of mixed economic news early in the session, with consumer spending up a better-than-expected 0.6 percent in July but an important consumer confidence index taking its biggest tumble since 2012 as trade war fears filter through to the public.

Trump also lashed out of at “badly run and weak companies,” saying they were blaming their problems on the tariffs. (AFP)