The gains also came after data showed increased private-sector hiring in August and better-than-expected services sector activity.
Major indices are "hitting their highest levels in more than a month... thanks primarily to the agreement between the US and China regarding another round of trade talks," said a note from Gorilla Trades strategist Ken Berman.
The Dow Jones Industrial Average climbed 1.4 percent to 26,728.15.
The broad-based S&P 500 gained 1.3 percent to 2,975.97, while the tech-rich Nasdaq Composite Index jumped 1.8 percent to 8,116.83.
The announcement on US-China talks comes less than a week after both Beijing and Washington enacted new tariff measures on each other. The grinding dispute has hung over markets for more than a year.
The report from payrolls firm ADP on private-sector hiring estimated August job growth at 195,000 new positions, above analyst expectations.
The data comes a day ahead of the government jobs figures, which are expected to show 171,000 jobs added last month.
The Institute for Supply Management's monthly non-manufacturing index leapt 2.7 points to a reading of 56.4, overshooting economists' expectations and hitting its highest level since May.
Large banks such as JPMorgan Chase and Citigroup jumped more than two percent as the yield on US Treasury notes increased, boosting hopes for banking profits.
Big tech companies also prospered, with Apple, Amazon and Google parent Alphabet winning two percent or more.
But Slack Technologies fell 3.4 percent after it projected a larger loss in the third quarter than analysts expect.