By Joe Wallace and Karen Langley

The S&P 500 edged higher Tuesday as investors cheered trade talks among senior U.S. and Chinese officials following weeks of escalating tensions between the world's two largest economies.

The broad stock index edged up 0.4% to set another closing record, while the Dow Jones Industrial Average dropped 0.2%. The tech-heavy Nasdaq Composite added 0.8%.

U.S. stocks have advanced in recent days, boosted by investors' optimism about a potential treatment for coronavirus. Last week, the S&P 500 notched its first closing record since February, and it has climbed from there.

"It's tough to really push through all-time highs," said Matt Hanna, portfolio manager at Summit Global Investments. "We have some resistance there."

Senior U.S. and Chinese officials said they were committed to carrying out the phase-one trade accord signed in January. A videoconference late Monday brought together U.S. Trade Rep. Robert Lighthizer, Treasury Secretary Steven Mnuchin and Chinese Vice Premier Liu He for a formal review of the deal.

Trade tensions between the U.S. and China buffeted markets last year before the world's two largest economies struck the phase-one deal in January. As relations soured over Covid-19, technology and the national-security law imposed by China on Hong Kong, investors worried that new frictions to trade and commerce would hurt the global economy.

"Of course it's positive when you have that kind of news flow -- it's reassuring," said Nadège Dufossé, head of cross-asset strategy at asset manager Candriam. "It's not in the U.S. and China's interest to have a new trade war."

Still, Ms. Dufossé said she wouldn't make investments based on Monday's review of the deal.

"It's positive in the short term, but it can change very rapidly," she said, adding that President Trump might seek to campaign for re-election by being tough on China. "On the technology front, I think frictions are here to stay."

Among individual stocks, shares in Raytheon Technologies, Pfizer and Exxon Mobil slipped 1.5%, 1.1% and 3.2%, respectively. The three companies are exiting the Dow Jones Industrial Average, S&P Dow Jones Indices said Monday, part of a makeover prompted by Apple's decision to split its stock.

Amgen and Honeywell International, which are among those replacing them, rose 5.4% and 3.2%, respectively. Salesforce.com, also joining the blue-chip index, gained 3.2%.

Elsewhere, J.M. Smucker shares rose 6.9% after the food manufacturer reported a surge in sales in its most recent fiscal quarter.

Overseas stock markets were mixed. The regional Stoxx Europe 600 dropped 0.3%. In Asia, Japan's Nikkei 225 rose 1.4% by the close. China's Shanghai Composite Index and Hong Kong's Hang Seng both posted muted losses.

In another sign of investor optimism, yields on 10-year Treasury notes ticked up to 0.693%, from 0.645% Monday. Yields rise as bond prices fall.

Gasoline futures rose 0.4% to $1.26 a gallon as Hurricane Laura barreled toward the Gulf of Mexico. More than one-third of the U.S.'s operable oil refineries are in the Gulf Coast region, according to the Energy Information Administration, prompting concerns that the storms could crimp gasoline production.

Laura strengthened into a hurricane Tuesday and is projected to make landfall near the Texas and Louisiana border Thursday, according to the National Oceanic and Atmospheric Administration.

Write to Joe Wallace at Joe.Wallace@wsj.com and Karen Langley at karen.langley@wsj.com