U.S. stocks closed higher Monday, with the S&P 500 having its best start to December in eight years, after the U.S. and China over the weekend called a temporary truce to their trade war, triggering relief buying of perceived riskier assets such as equities.

The Dow Jones Industrial Average DJIA, -0.41% rose 287.97 points, or 1.1%, to 25,826.43. The S&P 500 SPX, -0.83% climbed 30.20 points, or 1.1%, to 2,790.37. That is the large cap index’s strongest opening session for December, percentage wise, since it rallied 2.16% on Dec. 1, 2010, according to FactSet data.

The Nasdaq Composite Index COMP, -1.33% gained 110.98 points, or 1.5%, to 7,441.51.

Read: December historically is the most wonderful time of the year for stocks

What drove the market?

A trade standoff between the U.S. and China saw a breakthrough at the G-20 meeting in Argentina, a gathering that included a highly-anticipated dinner between President Donald Trump and Chinese leader Xi Jinping. The two sides agreed to launch negotiations to reduce trade tensions and discuss forced technology transfer, intellectual-property protection, non-tariff barriers, and cyber and agriculture issues, among other concerns.

Read:Tariff truce likely to ease investors’ immediate fears, but obstacles linger

And: U.S. and China call a truce in the trade war. Now what?

If those talks aren’t ultimately successful, planned tariffs on $200 billion of Chinese goods will rise to 25% from the current 10%, an increase that was due to kick in at the start of 2019, but will now be delayed by at least three months. China also said it would buy a “very substantial” amount of U.S. agriculture, energy and industrial goods.

As well, in a late-Sunday tweet, Trump said China had agreed to “reduce and remove” tariffs on U.S. cars, now set at 40%.

Trade optimism fed through to other assets, with crude oil US:CLF9 rallying more than 4%, as investors looked ahead to a meeting of the Organization of the Petroleum Exporting Countries on Thursday. Gains came as Russian President Vladimir Putin said over the weekend that Russia and Saudi Arabia have agreed to extend a deal to cut crude output. Separately, Qatar said it would withdraw from OPEC on Jan. 1.

The New York Stock Exchange and Nasdaq will close Wednesday as a national day of mourning will be held in memory of former President George H.W. Bush. A state funeral will be held the same day.

What data were in focus?

Markit released the latest results from its poll of manufacturers, issuing a reading of 55.3, just below the consensus estimate of 55.4, according to FactSet. A reading of at least 50 indicates improving conditions.

The closely watched Institute of Supply Management’s PMI gauge rose to 59.3, coming in better than economists’ expectations of 58.0, according to a MarketWatch poll of economists. The reading also was higher than last month’s 57.7 report.

At the same time, construction spending in October was 0.1% lower than in September, the Commerce Department said, which was weaker than expectations for a 0.3% rise from September.

What were strategists saying?

“It’s frustrating to see the market pull back a bit from the open,” said Timothy Chubb, chief investment officer of Univest Wealth Management. “But if you look at last week’s impressive rise, you can see that much of the good news was priced in ahead of time,” Chubb said, referring to investors generally believing that a pause on new tariffs would be achieved during the Trump-Xi summit.

“Who knows, President Xi and the Chinese authorities may pull a rabbit out of the hat through this new negotiating period and promote enough belief that the U.S. trade representatives permanently leave the tariffs on the $200 billion at 10%, but that is a big if,” said Chris Weston, head of research at currency broker Pepperstone, in a note to clients.

But for now, Weston said, the trade development has triggered a “global sigh of relief” for markets. Whether that is sustainable “will be now down to the economic data due through the week and whether OPEC now deliver the goods.”

What stocks were in focus?

Auto makers gained after Trump tweeted that China will cut tariffs on U.S. automobiles, with Ford Motor Co. F, -0.22% climbing 2% and General Motors Co. GM, -0.27% rising 3.9%.

Energy exploration firms were stronger after the reported Putin-OPEC agreement sent oil prices higher. Devon Energy Co DVN, -1.46% rose 6.4%, Marathon Oil Corp. MRO, -1.42% added 5.2% and Apache Corp. APA, -3.84% climbed 3.9%.

An easing of U.S.-China trade tensions was bullish for semiconductor companies in particular, as many U.S. firms have heavy exposure to Chinese markets. Qualcomm Inc. QCOM, -1.25% gained 1.5% while Micron Technologies Inc. MU, +1.91% rose 3.8% and Nvidia Corp. NVDA, -1.38% was up 4%.

How were other markets trading?

Asian stocks rallied, with Japan’s Nikkei NIK, -0.05% finishing 1% higher and the Shanghai Composite Index SHCOMP, +0.16% closing up 2.6%. European stocks also ended the day higher, with the Stoxx Europe 600 index SXXP, +0.55% adding 1%.

Gold prices US:GCG9 settled higher while the ICE Dollar Index DXY, +0.24% slipped.

—Barbara Kollmeyer contributed to this report