Stocks surged on Thursday after the U.S. and China agreed to meet next month in Washington to discuss trade.
The Dow Jones Industrial Average jumped 372.68 points, or 1.4% to 26,728.15. The S&P 500 climbed 1.3% to close at 2,976, led by a 2.1% gain in the tech sector, and closed around 1.7% from its record high. The Nasdaq Composite advanced 1.75% to 8,116.83.
"You have to be careful as we come up to 3,000 on the S&P 500," said JJ Kinahan, chief market strategist at TD Ameritrade. "I think we're going to have a tough time breaking through it unless there is some news other than they're going to talk."
"At some point, the proof is going to have to be in the pudding," he added. "I don't know that we're necessarily going to see that, so I think investors are going to have to be careful about getting too excited."
The VanEck Vectors Semiconductor ETF (SMH) climbed 3% as Advanced Micro Devices rose 1.8%. On Semiconductor gained 2.6%. Bank stocks such as J.P. Morgan Chase and Citigroup each closed more than 2% higher while trade bellwethers Caterpillar and Boeing rose 3.3% and 1%, respectively.
China's Commerce Ministry issued a statement Thursday morning saying that Liu He, Beijing's top negotiator on trade, had spoken with U.S. Trade Representative Robert Lighthizer and Treasury Secretary Steven Mnuchin.
The two sides agreed to hold another round of trade negotiations in Washington, D.C., towards the beginning of next month, and consultations will be made in mid-September in preparation for the meeting, the statement said.
"Both sides agreed they should work together and take practical actions to create favorable conditions for the negotiations," according to a CNBC translation of the statement.
The announcement came after the world's two largest economies imposed new tariffs on each other's goods at the start of the month, marking yet another escalation in the protracted trade war. Previously, both sides had indicated they would meet in September.
"Even though expectations for a robust trade deal are low, with global growth continuing to deteriorate as trade tensions mount, investors are relieved just to see talks are back on," said Alec Young, managing director of global markets research at FTSE Russell, in a note. "There's so much at stake that even incremental steps in the right direction are welcomed."
On the data front, private payrolls in the U.S. increased by 195,000, according to ADP and Moody's Analytics. Economists polled by Dow Jones expected payrolls to grow by 140,000. The report from ADP and Moody's Analytics is seen by investors as a preview to the U.S. government's monthly nonfarm payrolls report, which is scheduled for release Friday morning.
The payrolls data comes as the Federal Reserve is reportedly gearing up to lower interest rates by 25 basis points later this month. The move would follow another quarter-point rate cut back in July.
Meanwhile, the Institute for Supply Management said the U.S. services sector expanded at a faster-than-expected rate last month.
"We're seeing a combination of good news on trade and economic data," said Kate Warne, investment strategist at Edward Jones. Warne advised investors to stay cautious, however.
"The reality is the fundamentals are solid, but they are not as solid as this suggests," Warne said. "They are also not as weak as the past few weeks suggest."
—CNBC's Evelyn Cheng, Sam Meredith, Weizhen Tan and Eamon Javers contributed to this report.