By Gunjan Banerji
U.S. stocks surged Friday as investors cheered progress on trade negotiations between the U.S. and China, helping the S&P 500 break a three-week losing streak.
President Trump said just before the closing bell that the two countries reached a "very substantial Phase One deal" and agreed not to implement tariffs set to go into effect next week. China, meanwhile, said it would increase purchases of U.S. agricultural products.
Friday's talks elicited optimism among investors and helped pull the S&P 500 and Dow Jones Industrial Average within 2% of their July records. Trade tensions have been a key driver of market volatility this year as investors have reacted to fresh tariffs between the two countries--and tweets from President Trump on the state of the talks.
In a sign of how eager investors have been for a resolution on trade, anticipation of a deal was enough to lure some investors back into stocks and push them out of traditionally safer bets like gold, the Japanese yen and Treasurys.
"This has been an irritant, I would say, for investors," said John Carey, a portfolio manager at Amundi Pioneer Asset Management. A final deal "would ease at least one source of worry."
The Dow industrials closed up 319.92 points, or 1.2%, to 26816.59. The index rose as much as 517 points earlier in the session but pared some of those gains as traders learned that two pressure points remained unresolved: a final decision on a new round of tariffs set for December and policies around Chinese telecom giant Huawei Technologies Co.
The S&P 500 surged 32.14 points, or 1.1%, to 2970.27. The rally was broad-based, with eight of the S&P 500's 11 sectors climbing. Both the Dow and S&P 500 averted a fourth straight week of losses.
The Nasdaq Composite added 106.26 points, or 1.3%, to 8057.04.
Shares of industrials companies were among the biggest gainers. Caterpillar, which has been a bellwether stock for trade, recorded its biggest jump since January, adding $5.71, or 4.7%, to $128.40. Apple shares rose $6.12, or 2.7%, to $236.21, a fresh record.
Overseas, Hong Kong's Hang Seng rose 2.3% and the Shanghai Composite gained 0.9%.
"Actions speak louder than words," said David Madden, an analyst at CMC Markets U.K. "At the end of the day, if the two sides were not interested in having some progress, they wouldn't even be meeting today."
The prospect of a trade deal also helped calm fears of a recession that had simmered in recent months. U.S. consumer sentiment rose in early October, according to a University of Michigan survey released Friday. Investors have been closely watching for signs that lackluster manufacturing data around the world will spill over to the consumer, which has been a source of strength in the U.S. economy.
The yield on the 10-year Treasury note rose to 1.748% Friday, from 1.649% Thursday, its biggest single-day jump since September. Yields rise as bond prices fall. The Federal Reserve said Friday that it will start buying Treasury bills to boost its balance sheet to avoid the unexpected strains in money markets experienced last month.
Tensions appeared to calm in Europe, too. British Prime Minister Boris Johnson and his Irish counterpart, Leo Varadkar, unexpectedly said they saw a chance of a Brexit deal.
The British pound jumped against the dollar, recording its biggest two-day gain since December 2008, while shares of U.K. banks and homebuilders advanced as investors grew more optimistic about the U.K.'s divorce deal with the European Union.
"Those were sort of the two biggest economic uncertainties facing the market," said Jerry Lucas, senior trading strategist at UBS Global Wealth Management, of U.S. and China trade and Brexit. "There's cause for optimism right now."
Meanwhile, the yen fell to its lowest level against the U.S. dollar since August, while gold prices dropped 0.8%.
Still, some investors said it was too soon to wager on a cease-fire between the U.S. and China, given how turbulent negotiations have been.
"There's been such a back and forth on trade," said John Porter, chief investment officer at Mellon Investments Corp. "When I see a conclusive agreement in place, then I'll react to the details."
In commodity markets, crude oil prices gained after an Iranian tanker near the Saudi Arabian coast suffered damage Friday in what the ship's owner suggested may have been a missile attack.
Will Horner contributed to this article.
Write to Gunjan Banerji at Gunjan.Banerji@wsj.com