U.S. stocks barely budged Friday after closing at all-time highs on Thursday after President Donald Trump tweeted that the U.S. and China have reached a deal in their costly trade war that avoids billions in new tariffs scheduled to start December 15.

"We have agreed to a very large Phase One Deal with China," Mr. Trump wrote on Twitter. "They have agreed to many structural changes and massive purchases of Agricultural Product, Energy, and Manufactured Goods, plus much more. The 25% Tariffs will remain as is, with 7 1/2% put on much of the remainder...."

We have agreed to a very large Phase One Deal with China. They have agreed to many structural changes and massive purchases of Agricultural Product, Energy, and Manufactured Goods, plus much more. The 25% Tariffs will remain as is, with 7 1/2% put on much of the remainder.... — Donald J. Trump (@realDonaldTrump) December 13, 2019

After an initial slide on Friday, the Dow finished the trading day up a mere 3 points, or just 0.01%, to 28,135. The S&P 500-stock index also rose a wisp, up 0.01% to 3,168, while the tech-heavy Nasdaq composite rose 0.2% to 8,734.

Get Breaking News Delivered to Your Inbox

The modest "Phase One" trade agreement — first promised in October — will at least de-escalate a nearly two-year trade war that Mr. Trump once called "easy to win," but investors may have been hoping for a wider-ranging agreement.

The market has been quick to react to conflicting headlines and remarks out of the Trump administration about the trade war that began with tariff threats in January 2018, when the S&P 500 was approaching 2,900. Uncertainty over trade has been the biggest wild card for stocks ever since. The longstanding conflict has slowed manufacturing growth around the world and caused U.S. businesses to hold back on making investments. The saving grace for the American economy has been a strong job market and consumer spending.

"While it is great news for consumers and businesses that Sunday's tariffs are not going into effect, the modest gains in the stock markets today are proof of how much uncertainty still remains even after a partial trade deal with China was reached," Michelle Casario, an associate professor at Villanova University, told CBS MoneyWatch.

"There are more questions than answers," Casario continued. "How realistic is it to think that China can or will increase their purchases of US agricultural products enough to satisfy the president? We could be a tweet away from a reversal of progress and a return to tariff escalation."

Still, Wall Street analysts said they believe a U.S.-China deal could boost investor confidence and alleviate global anxiety about trade.

"This is definitely better than our base-case scenario and removes some worries about the trade war escalating further and weighing on the growth momentum," TD Securities said in a note to clients on Friday morning, before both China and the White House announced a deal had been struck.

Mr. Trump wrote on Twitter that the agreement is an "amazing deal" for the U.S.

.....The Penalty Tariffs set for December 15th will not be charged because of the fact that we made the deal. We will begin negotiations on the Phase Two Deal immediately, rather than waiting until after the 2020 Election. This is an amazing deal for all. Thank you! — Donald J. Trump (@realDonaldTrump) December 13, 2019

"The Penalty Tariffs set for December 15th will not be charged because of the fact that we made the deal. We will begin negotiations on the Phase Two Deal immediately, rather than waiting until after the 2020 Election," he wrote.

"Big deal" with China

Shares jumped on Thursday after Mr. Trump claimed the U.S. was getting close to a "big deal" with China. Traders were also encouraged by a Wall Street Journal report saying Washington has offered to slash existing tariffs and cancel new ones set to kick in on Sunday in exchange for billions more worth of agricultural purchases and intellectual property protection from China.

"If we do see the tariffs removed, that's saying, 'OK, China must be agreeing to things or we must be right there,'" said Ben Phillips, chief investment officer at EventShares. "That's why the market is looking at tariffs as the bellwether to a trade deal."

Speculation that the world's two biggest economies could be close to reaching a Phase 1 trade agreement spurred investors on Thursday to move money into technology, industrial and other stock sectors that tend to do well when the economy is growing.

"If we get a China trade deal, it's probably going to catalyze another 12-plus months of growth in the U.S. and globally," Phillips said.