U.S. stocks surged in early trading Monday after the U.S. and China agreed to a 90-day truce in their escalating trade dispute, sending the Dow Jones Industrial Average up 300 points.

Technology companies led the rally, which followed gains in overseas markets as investors welcomed news of the trade pact, which was struck over dinner between President Donald Trump and his Chinese counterpart Xi Jinping at the G-20 summit over the weekend.

The long-running dispute between the world’s two largest economies has rattled investors for months, stoking traders’ fears that it could begin dragging down corporate profits and weighing on global economic growth.

Technology stocks, industrial companies and banks accounted for much of the market’s gains, offsetting losses in household goods makers and utilities. Energy stocks also rose as U.S. crude oil prices rose sharply.

The long-running dispute between the world’s two largest economies has rattled investors for months.

The S&P 500 index gained 26 points, or 1 percent, to 2,785 as of 10:15 a.m. Eastern Time. The Dow climbed 270 points, or 1.1 percent, to 25,814. The average was up as much as 441 points earlier.

The Nasdaq composite jumped 94 points, or 1.3 percent, to 7,424. The Russell 2000 index of smaller-company stocks added 16 points, or 1.1 percent, to 1,549.

Markets in Europe also climbed. Germany’s DAX gained 2.1 percent, while France’s CAC 40 rose 1.3 percent. Britain’s FTSE 100 added 1.7 percent.

Presidents Trump and Jinping of China met at the G-20 summit over the weekend and agreed to a cease-fire, lasting for at least 90 days, to allow time to smooth out a dispute over Chinese technology policies that the U.S. and other trading partners consider predatory.

Trump agreed to hold off on plans to raise tariffs on $200 billion in Chinese goods, which were supposed to kick in on Jan. 1. In return, Xi agreed to buy a “very substantial amount” of agricultural, energy and industrial products from the U.S. to reduce its large trade deficit with China, the White House said.

While the truce has the potential to steady markets through the end of the year, the countries still need to hammer out a lasting trade deal.

“Three months is not a very long time to achieve this so there are naturally plenty of skeptics out there but this is a rare piece of good news in a conflict that has yet to produce any,” said Craig Erlam, senior market analyst at OANDA.

Gains in technology companies helped drive the market higher. Chipmaker Advanced Micro Devices jumped 9.3 percent to $23.27.

The trade truce also helped lift energy futures. Traders also were also digesting the news that Qatar will withdraw from OPEC in January. Benchmark U.S. crude was up 3.9 percent to $52.90 per barrel in New York. Brent crude, the international standard, rose 3.7 percent to $61.66 per barrel in London.

The pickup in oil prices gave energy stocks a boost. Devon Energy climbed 6.1 percent to $28.65.

Bond prices fell. The yield on the 10-year Treasury note rose to 3.02 percent from 3.01 percent.

The dollar rose to 113.51 yen from 113.61 yen late Friday. The euro strengthened to $1.1355 from $1.1309.

Major indexes in Asia finished higher. Hong Kong’s Hang Seng surged 2.6 percent, while Japan’s Nikkei 225 index climbed 1 percent. The Kospi in South Korea jumped 1.7 percent. The S&P ASX/200 in Australia added 1.8 percent. Shares rallied in Taiwan and throughout Southeast Asia.