U.S. equities closed well off session highs Thursday after President Donald Trump said he's willing to act alone on North Korea if China does not step up.

Trump and State Secretary Rex Tillerson also signaled it seeks to remove Bashar Assad from power in Syria, an apparent reversal following a suspected chemical attack the White House has blamed on the Syrian government.

"The market just feels like it's a bit twitchy," said Daniel Deming, managing director at KKM Financial. "It had been trying to hold on to those gains all day, but it's thinking that a lot could happen in the next 24 hours."

The Dow Jones industrial average closed about 15 points higher, with Caterpillar contributing the most gains. The S&P 500 held 0.2 percent higher, with energy leading advancers. The Nasdaq composite ended 0.25 percent higher.

The three major indexes traded about 0.3 percent higher before Trump's comments, which were made as he prepared for a key meeting with Chinese President Xi Jinping.

"There's a lot of noise out in the market right now," said Arian Vojdani, investment strategist at MV Financial. "People are trying to figure out which way to go."

"We've seen a general complacency in the market recently," he said. " But at some point the market will have to take stock of itself."

The two-day meeting was set to begin Thursday in Mar-a-Lago and the two leaders are expected to discuss a series of issues, including trade and North Korea.

"With Trump in the past repeatedly accusing China of keeping its currency at artificially low levels against the dollar and stealing American jobs, the outcome of the meeting is something that remains unknown," said Lukman Otunuga, research analyst at FXTM.