Stocks jumped on Tuesday after Chinese President Xi Jinping said Beijing would reduce tariffs on imported cars and improve intellectual property protection, steps that could ease trade tensions.
Facebook was among those that climbed as CEO Mark Zuckerberg testified before the Senate about the company's privacy scandal.
Mr Xi's proposals could help the US and China resolve their differences and avert a trade dispute that slows down global commerce. The easing back of tensions helped send the price of crude oil up 3.3%.
"The market's increasing expectation is that the two sides will sit down now," said Paul Christopher, head of global market strategy for Wells Fargo Investment Institute. "There's still a lot at stake because you have a global supply chain that could be interrupted because of tariffs."
Facebook, Twitter and Snap rallied as senators questioned Mr Zuckerberg about the Cambridge Analytica privacy scandal that has engulfed the company over the last four weeks.
Technology companies have stumbled as investors wondered if the government will implement tighter regulations on technology companies and those worries eased on Tuesday. Mr Zuckerberg will testify before the House of Representatives on Wednesday.
The S&P 500 index surged 43.71 points, or 1.7%, to 2,656.87. The Dow gained 428.90 points, or 1.8%, to 24,408. Shortly before noon it rose as much as 532 points.
The Nasdaq composite added 143.96 points, or 2.1%, to 7,094.30. The Russell 2000 index of smaller-company stocks advanced 28.97 points, or 1.9%, to 1,543.43.
Indexes overseas also climbed. Germany's DAX jumped 1.1% and the British FTSE 100 gained one per cent. The French CAC 40 gained 0.8%. Japan's benchmark Nikkei 225 gained 0.5% and South Korea's Kospi added 0.3% while Hong Kong's Hang Seng added 1.7%.
Speaking at a business conference, Mr Xi promised changes in some areas that the US has identified as priorities. He did not address other thorny topics including requirements for foreign companies to give technology to potential local competitors.
General Motors rose 3.3% to 39.07 US dollars (£27.56) and Tesla climbed 5.2% to 304.70 dollars (£214.95).
Technology companies have made some of the biggest swings on the market during the trade spat. If trade conditions get worse, they might face higher costs as well as lower sales.
They have also done better than most other parts of the market lately and companies like Apple, Microsoft and Google's parent Alphabet have made up an outsize portion of the market's gains.
Apple jumped 1.9% to 173.25 dollars (£122.22) and Microsoft rose 2.3% to 92.88 dollars (£65.52).
Facebook CEO Mark Mr Zuckerberg appeared before two Senate committees that comprised almost half the Senate and was questioned about the Cambridge Analytica scandal. As many as 87 million users were affected and Facebook started notifying them this week.
Facebook shares have dropped sharply since the scandal emerged in March. They rose 4.5% to 165.04 dollars (£116.43) on Tuesday while Twitter jumped 5.3% to 29.53 dollars (£20.83) and Snap gained 2.3% to 14.48 dollars (£10.21).
Benchmark US crude rose 3.3% to 65.51 dollars (£46.21) a barrel in New York. Brent crude, used to price international oils, added 3.5% to 71.04 dollars (£50.12) a barrel in London.
Oil prices have bounced up and down recently as investors wonder if the trade dispute will hamper global economic growth.