Stocks are surging on Wall Street Thursday as China and the U.S. prepare to hold their first trade discussions in months, a potential sign of progress toward ending the trade war between them. Walmart soared after reporting its strongest growth in sales in more than a decade. Metals prices rose sharply, a day after a big drop, and the price of crude oil moved higher.

KEEPING SCORE: The S&P 500 index climbed 22 points, or 0.8 percent, to 2,841 at closing time. The Dow Jones Industrial Average jumped 396 points, or 1.6 percent, to 25,559 as Walmart and Boeing made big gains. The Nasdaq composite rose 32 points, or 0.4 percent, to 7,807.

The Russell 2000 index of smaller-company stocks added 15 points, or 1 percent to 1,686.

It’s the latest big swing for stocks over the past week. The S&P 500 is on track for its biggest gain since June 1 just a day after its biggest loss in six weeks. The Dow is on pace for its bigger gain since April.

Stocks slumped Friday and Monday as investors worried about Turkey’s currency crisis, then rebounded Tuesday only to fall again Wednesday on rising concerns about China’s economic growth.

TRADE HOPES: China will send a trade envoy to Washington in late August in a new attempt to end the trade dispute between the world’s two largest economies. The countries are in conflict over technology policy and China’s trade surplus with the U.S.

The two sides haven’t held talks since early June. After those talks, both countries put taxes on $34 billion in each other’s imports. Those taxes are set to rise next week, and both countries have threatened even larger increases.

THE QUOTE: Jason Draho, the head of asset allocation for UBS, said investors are eager for the two countries to start making progress and resolve their differences. He added that China may be changing course because its economy has slowed.

“The data we’ve seen from China recently has showed slowing growth,” he said. “It’s possible they decided ‘OK, we need to take a different approach’ and come to the table offering a little more.”

WOW FOR WALMART: Walmart posted its biggest gain in sales at stores open at least a year, and its online revenue grew 40 percent, a faster pace than it reported in the first quarter. The stock jumped 9.6 percent to $98.91, which wiped out its losses from earlier this year.

Other retailers and consumer goods companies also edged higher. Target added 1.8 percent to $82.15 and Procter & Gamble rose 1.7 percent to $83.70 while McDonald’s climbed 1.3 percent to $161.90.

SOFTWARE SURGE: Symantec jumped 5.2 percent to $19.52 after the activist investment firm Starboard Value disclosed a 5.8 percent stake in the company and said it plans to nominate five directors for spots on Symantec’s board of directors.

Symantec said it has been talking to Starboard for the past several weeks and is evaluating the candidates it nominated.

DEPARTMENT STORES DUMPED: J.C. Penney tumbled 25.1 percent to $1.81 after it took a bigger loss than analysts expected and reported weaker sales. The chain also cut its forecasts for the year again. Dillard’s dropped 11 percent to $73.87 after its report.

Department stores have made big gains this year, but they dropped Wednesday after Macy’s said its sales growth slowed during the second quarter.

Macy’s inched up 1.6 percent to $35.72 after a 16 percent plunge the day before. Nordstrom and Kohl’s also managed small gains.

FEELING QUEASY: Chipotle lost 4.4 percent to $502.72 after Ohio heath officials said tests tied to one store came back positive for an illness that occurs when food is left at unsafe temperatures.

The company closed a store in Powell, Ohio in July for cleaning after it learned about the reported illnesses. Chipotle says it will retrain all restaurant employees on food safety procedures.

COMMODITIES: Oil prices were steady after a sharp drop a day earlier. U.S. crude inched up 0.7 percent to settle at $65.46 a barrel in New York. Brent crude, the standard for international oil prices, picked up 0.9 percent to $71.43 per barrel.

Metals prices also turned higher. Gold dipped 0.1 percent to $1,184 an ounce. Silver rose 1.8 percent to $14.71 an ounce. Copper added 2.2 percent to $2.62 a pound. That made up for much of Wednesday’s loss, but copper prices are still down 20 percent since early June.

EPIPEN EPIC WIN: Teva Pharmaceutical Industries jumped 7.3 percent to $24.11 after U.S. health officials approved its generic version of EpiPen, the emergency allergy medication made by Mylan. The injections are stocked by schools and parents to treat allergic reactions to food and bug bites.

BONDS: Bond prices turned lower again. The yield on the 10-year Treasury note rose to 2.87 percent from 2.85 percent. That helped send bank stocks higher. JPMorgan Chase rose 1.1 percent to $114.96 and Bank of America added 1.5 percent to $30.81.

CURRENCIES: The dollar rose to 110.88 yen from 110.57 yen. The euro rose to $1.1365 from $1.1346.

OVERSEAS: Germany’s DAX added 0.6 percent and in France the CAC 40 rose 0.8 percent. Britain’s FTSE 100 rallied 0.8 percent.

Japan’s Nikkei 225 index fell 0.1 percent and the Hang Seng in Hong Kong lost 0.8 percent. South Korea’s Kospi reopened from a holiday and tumbled 0.8 percent.

© The Associated Press. All rights reserved