Gains in technology and energy companies helped drive stocks broadly higher on Wall Street Thursday afternoon, nudging the S&P 500 closer to a new high.

The benchmark index was hovering around the record close it reached April 30. A strong rebound for stocks this month has erased most of the S&P 500’s losses from May, when jitters over the escalating trade conflict between the U.S. and China knocked the market into a 6.6% dive.

The market’s recovery gained momentum this week as investors became more hopeful that Washington and Beijing could eventually resolve their damaging trade war. Traders have also become more confident that the Federal Reserve stands ready to stabilize economic growth.

The S&P 500 was up 0.6% as of 1:46 p.m. Eastern Time. The Dow Jones Industrial Average rose 171 points, or 0.7%, to 26,675. Big gains for Boeing, 3M, and Home Depot helped drive the 30-stock index higher.

The technology-heavy Nasdaq composite gained 0.5%, while the Russell 2000 index of smaller companies was 0.5% higher.

Major stock indexes in Europe also rose.

Technology stocks accounted for a big share of Thursday’s gains. Oracle led the sector, climbing 7.6% after the software company reported solid financial results. Mastercard rose 2.3%.

Crude oil prices surged 5.4% as tensions between the U.S. and Iran intensified, stoking fears that oil shipments through the Strait of Hormuz could be compromised. Iran’s Revolutionary Guard said it shot down a U.S. drone on Thursday over Iranian airspace. The drone shooting follows last week’s attack on two oil tankers near the Gulf of Oman. The spike in oil prices sent energy sector stocks broadly higher. Noble Energy gained 5.9%.

Bond yields continued to slide a day after the Federal Reserve signaled that it is prepared to cut its benchmark interest rate if needed to shield the U.S. economy from trade conflicts or other threats. While the central bank left interest rates unchanged, investors are betting on at least one interest rate cut this year.

The yield on the 10-year Treasury note fell to just under 2%, the lowest level since November 2016. The decline in bond yields weighed on financial stocks. Lower bond yields pull down the interest rates that banks charge on loans. SunTrust Banks dropped 1.8%.

Shares in work messaging platform Slack surged in their stock market debut. The company’s shares opened trading at $38.25 and were up 59.4% in afternoon trading. Ride-hailing companies Uber and Lyft, video conferencing company Zoom Video Communications and digital scrapbooking site Pinterest have all gone public in recent weeks.

Darden Restaurants rose 1.8% after the operator of the Olive Garden restaurant chain reported weaker-than-expected sales growth during its fiscal fourth quarter.

Traders bid up shares in Alexion Pharmaceuticals after the biotechnology company said the FDA is reviewing its drug Ultomiris as a potential treatment for a rare condition that can lead to organ damage and kidney failure. The stock climbed 3.5%.

Cruise line operators were among the few losers after Carnival slashed its profit forecast for the year. The company cited technical issues with its Vista ship. It also cited a ban on U.S. cruises to Cuban ports and an economic slowdown in Europe, which have broader implications for the sector. Carnival sank 8.8%, Royal Caribbean Cruises fell 3.5% and Norwegian Cruise Line slid 3.2%.


AP Business Writer Damian J. Troise contributed to this report.