Stocks finished with broad gains on Wall Street Thursday, driving the Dow Jones Industrial Average more than 300 points higher.
The buying spree gave the market its second straight gain after a wobbly start to the week. The S&P 500 is now on track for its first weekly gain in five weeks.
The rally was spurred by fresh hope among investors that new talks between the U.S. and China set for September can lead to progress in the nations' ongoing trade war.
"Investors are hoping that some sort of renewed discussions could lead to a genuine truce," said Sam Stovall, chief investment strategist at CFRA. "All the market is trading on today is optimism, not on reality."
The S&P 500 rose 36.64 points, or 1.3%, to 2,924.58. The Dow climbed 326.15 points, or 1.3%, to 26,362.25. The Nasdaq gained 116.51 points, or 1.5%, to 7,973.39.
Investors favored smaller company stocks for the second straight day. The Russell 2000 index added 24.01 points, or 1.6%, to 1,496.72.
Major stock indexes in Europe also closed broadly higher.
While the major indexes have stemmed some of their losses from earlier this month, they remain down about 2% for the month with one trading day left in August. If those losses hold, August would be the second monthly drop for the market this year after May.
Uncertainty over the costly and long-running trade conflict fueled a wave of market volatility through much of August as traders worried that it could knock the global economy into a recession and hurt corporate profits.
But Thursday brought some tendrils of optimism for traders. A published report noted that China's commerce ministry said it is discussing the next round of in-person trade negotiations with the U.S. to be held next month.
In an interview with Bloomberg, Treasury Secretary Steven Mnuchin said talks with China are ongoing and are expected to continue in Washington, though he did not specify when.
Trade negotiators are due to meet in September for new negotiations, though there has been no sign of progress in recent days since an escalation by both sides earlier this month.
A mixed batch of new economic data didn't dampen Thursday's market rally.
The government reported that gross domestic product, the broadest gauge of economic health, advanced at a moderate 2% annual rate in the April-June quarter, down from a 3.1% gain in the first quarter. The figure was lower than the government's initial estimate a month ago of 2.1% growth.
And business investment, which has weakened in the face of the Trump administration's trade wars, was revised lower and subtracted from growth in the April-June period.
At the same time, consumer spending shot up to an annual rate of 4.7% in the second quarter, the best showing since the final quarter of 2014. That helped put investors in a buying mood.
"While GDP was in line or slightly lower, the consumer piece of it, which accounts for two-thirds of our economy, was really strong and that's one of the reasons behind the rally," Katz said.