Stocks stumbled on Friday as worries flared yet again that President Donald Trump's trade war with China may be worsening.

It was a fitting end to a wild week where markets zoomed down, up and down again as investors recalibrated by the minute how much the tensions will hurt the global economy.

The S&P 500 dropped as much as 1.3% on Friday after Mr Trump said that it would be "fine" if a meeting on trade with China next month does not happen, before nearly eliminating the loss.

It dropped again in the final minutes of trading and ended the day at 2,918.65, down 19.44 points, or 0.7%.

The Dow Jones Industrial Average fell 90.75, or 0.3%, to 26,287.44, and the Nasdaq lost 80.02, or 1%, to 7,959.14.

To anyone not paying attention, the numbers could paint the last week as a mixed one for markets. The S&P 500 was down just 0.5% but that stretch included the worst plunge of the year for the S&P 500, as well as its best day in months.

Through the week, investors' mood pinballed from fear that China was raising the stakes in the trade war by weakening its currency to relief that the yuan's drop was not more sharp and back to concern that the US and China may not even meet next month to talk about their problems.

All of that was a follow-up to Mr Trump's threat last week to impose more tariffs on Chinese goods.

Underscoring the uncertainty, investors said they had no good explanations for some of the sharp swings that stocks had over the last week.

While nowhere near as bad as it got during the Great Recession, investors' fear about the uncertain path forward for corporate profits and the global economy sent gold prices jumping and bond yields tumbling.

"We don't really see an end to the uncertainty any time soon," said Sameer Samana, senior global market strategist at Wells Fargo Investment Institute.

Beyond the US-China trade war, he also pointed to the upcoming US elections, the pending British exit from the European Union and a completely separate trade war between South Korea and Japan, among other things.

"Unfortunately, it's tough to tell whether we're at peak uncertainty, but the level of uncertainty is high. What's remarkable is how close the markets still are to their all-time highs despite all the uncertainty."

The S&P 500 is only 2.1% below its record, which was set at the end of July. It is also up 9% since Mr Trump said in March 2018 that "trade wars are good, and easy to win".

The economy is still growing, and the unemployment rate remains near its lowest level in half a century.

The fear is that all the uncertainty that has caused stock prices to swing sharply could also make businesses and shoppers more cautious.

If they pull back on their spending, it could lead to weaker profits for companies, which could cause businesses to cut back on hiring, which could do real damage to the economy.