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.