U.S. stocks notched significant gains Friday, though they closed off session highs, after reports that the U.S. and China had reached an agreement to ease trade tensions that includes the elimination of at least some planned tariffs.

The Dow Jones Industrial Average DJIA, +1.33% rose 319.92 points, or 1.2%, to 26,816.59, the S&P 500 index SPX, +1.59% advanced 32.14 points, or 1.1%, to 2,970.27, while Nasdaq Composite Index COMP, +2.26% gained 106.26 points, or 1.3%, to 8,057.04.

At session highs, the Dow had risen 517.30 points, or 2%, the S&P 500 had gained 55.15 points, or 1.9%, while the Nasdaq had added 165.01 points, or 2.1%.

For the week, the Dow rose 0.9%, while the S&P 500 and Nasdaq added 0.6% and 0.9% respectively.

What drove the stock market?

President Trump said that the U.S. and China had reached a “substantial, phase-one” deal to ease trade tensions that will include Chinese promises to buy $40 - $50 billion more U.S. agricultural products in exchange for eliminating a planned increase in tariffs that had been set to into effect Tuesday Oct. 15.

No decision has been made yet on planned on a new 15% tariff set to go into effect on Dec. 15 on about $160 billion in annual Chinese imports.

The president’s statement came just minutes before the close of trade Friday.

The agreement will take three to five weeks to finalize and will also include “certain intellectual property measures” and other promises on the part of the Chinese related to its currency management, Trump said after a meeting with Mr. Liu in the White House.

The news was expected by investors after President Donald Trump tweeted that ‘good things are happening’ at the trade negotiations.

The Wall Street Journal reported that terms for a possible tentative deal could also include a joint pact to deter Beijing from devaluing its currency, and, on the U.S. side, relaxing export bans against blacklisted Chinese telecom giant Huawei Technologies Co.

“The US and China were able to make a partial deal, setting up hopes for a prolonged trade truce, wrote Edward Moya, senior market analyst at Oanda. “The positive trade update took US stocks higher and is putting the pressure on safe-havens . . .US equities could resume the march toward uncharted territory if we see continued a de-escalation in all tariffs over the coming weeks.”

China overnight Friday set a timetable for opening its finance industries. The China Securities Regulatory Commission said Friday overseas financial service companies in futures, securities and mutual funds will be able to apply for total control of onshore ventures starting in 2020. The move came as the country speeds up its financial markets opening.

On the data front, University of Michigan’s preliminary consumer sentiment report came in at 96, above economists’ estimates for a reading of 92, according to Econoday. Meanwhile, the import price index climbed 0.2% last month, the government said Friday. The cost of goods imported into the U.S. rose in September for the first time in four months, but most of the increase stemmed from higher oil prices.

Sentiment was also buoyed after the Federal Reserve announced that it would buy $60 billion of Treasury bills every month at least into the second-quarter, starting from next week. The central bank also said it would conduct overnight repurchase agreements at least through January of next year in order to reduce pressures in funding markets.

Meanwhile, investors were parsing a speech by Boston Fed President Eric Rosengren — one of three dissenters in the Fed’s last decision — who continued to emphasize his skepticism of Fed easing, telling an audience Madison, Wis. that “my view is that policy makers can be patient and continue to evaluate incoming data before taking additional action.”

See also: Bank stocks surge as U.S.-China trade hopes lift Treasury yields

Which stocks were in focus?

Shares of Apple Inc. AAPL, +3.75% advanced 2.7% to a new record close after analysts at Wedbush raised its stock price target to $265 from $245. If the stock closes above $232.07, it will set a new all-time high.

The stock for Voxx International Corp. VOXX, +1.87% fell 0.9% even after the technology manufacturer reported that its operating losses fell in the first half of the year.

Shares of Wendy’s Co. WEN, +0.66% rose 4% Friday after the fast-food retailer announced third-quarter same-store sales that beat expectations, while raising its dividend.

Shares of Bed Bath & Beyond BBBY, +4.30% advanced 7.4% after it named Target Corp.’s TGT, +1.54% head of merchandising as its new chief executive.

How did other assets trade?

The yield on the 10-year U.S. Treasury note TMUBMUSD10Y, 0.657% climbed to 1.737%, compared with 1.649% on Thursday.

Gold futures held below the psychologically significant level at $1,500. December gold US:GCZ19 fell $12.20, or 0.8%, to settle at $1,488.70 an ounce.

West Texas Intermediate crude for November delivery US:CLX19 climbed $1.15, or 2.2%, to settle at $54.70 a barrel on the New York Mercantile Exchange, after an oil tanker attack in the Middle East.

In Asia overnight Friday, Hong Kong’s Hang Seng Index HSI, -0.32% surged 2.3% to 26,308.44, the China CSI 300 000300, +0.15% rose 1% to reach 3,911.73, and Japan’s Nikkei 225 NIK, +0.50% gained 1.2% to 21,798.87. The Stoxx Europe 600 SXXP, -0.09% , meanwhile, closed 2.3% higher to 391.61. And the FTSE 100 UKX, +0.34% gained 0.3% to 7,186.36, even as the pound jumped 1.8% against the dollar, amid renewed Brexit optimism.

— Mark Decambre contributed to this report.