New York CNN Business  — 

The Dow and the broader stock market rallied sharply on Thursday, logging its best day in three weeks, after US and Chinese officials said they will resume trade talks.

The escalating tensions between the world’s two largest economies has weighed on markets throughout the summer. But the new talks, on the agenda for early October, are spurring optimism.

Stocks soared in response, with the Dow (INDU) rising 379 points, or 1.4%, closing at its best level since July 31. It was its best one-day percentage gain since August 13.

The S&P 500 (SPX) finished 1.3% higher, logging its best day since August 16, while the Nasdaq Composite (COMP) climbed 1.8%. It was the index’s best session since August 13, according to Refinitiv. All three indexes also finished higher on Wednesday, retracing the prior days losses.

“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 emailed comments.

“There’s so much at stake that even incremental steps in the right direction are welcomed. The bottom line is that stocks need earnings growth to move forward, and you can’t get that without progress on US-China trade,” Young said.

Investors are also gearing up for Friday’s US jobs report, which is expected to show some weakness thanks to the summer lull and the trade war.

Ahead of Friday’s report, private payrolls for August beat expectations at 195,000. Jobless claims for the week ending August 31 came in just above expectations at 217,000.

The IHS Markit Services PMI showed a loss of momentum in the US service sector in August. At the same time, the Institute of Supply Management’s non-manufacturing index rose compared with July.

The conflicting data of America’s services sector comes as the country’s manufacturing sector contracted for the first time in three years last month.