The S&P 500 and the Nasdaq gained ground on Wednesday with a boost from artificial intelligence-related tech shares, which helped markets look past hotter-than-expected U.S. inflation data and the growing probability that the Federal Reserve will hold to ⁠its restrictive ​monetary policy for the foreseeable future.

The S&P 500 and the Nasdaq reversed earlier declines to notch fresh record closing highs, as chip stocks rebounded from Tuesday’s decline. Six of the Magnificent Seven group of AI-related megacaps gained between 1.4% and 3.9%.

The TSX, however, closed well in negative territory, with financial stocks under pressure.

“In the face of continued hot inflation data, [U.S.] technology remains resilient,” said Ryan Detrick, chief market strategist at Carson Group in Omaha, Nebraska. “And after some weakness [Tuesday], the chip stocks came soaring back.”

A report ​from the Labor Department showed U.S. producer prices jumped by 1.4% last month, the largest monthly increase ‌in four years. While the surge was largely driven by crude supply disruption due to the closure of the Strait of Hormuz, the report showed soaring oil prices are beginning to seep into other segments of the economy, and suggested that rising inflation is becoming pervasive.

Recent inflation data is dousing any remaining hopes for a near-term rate cut from the Federal Reserve. In fact, Boston Fed President Susan Collins said on Wednesday that a rate hike could be in the cards if inflation pressures fail ‌to subside. Kevin Warsh, President ​Donald Trump’s nominee to succeed Fed Chair Jerome ‌Powell, was confirmed by the Senate in a vote along party lines.

“I would just be careful to not overlook the risk of a more prolonged ​period of inflation and elevated interest rates,” said Jim Baird, chief investment officer at ⁠Plante Moran Financial Advisors in Southfield, Michigan. He added that the PPI report “reinforces the inflation risk narrative and at least ⁠makes the case for a longer pause at the Fed.”

Trump arrived in Beijing, along with an entourage that included Nvidia Chief Executive Officer Jensen Huang and Elon Musk, ​ahead of a two-day summit with his Chinese counterpart Xi Jinping. Topics on the agenda include urging Xi to “open up” to U.S. businesses and maintaining a fragile trade truce. Trump will also seek to bolster his approval rating, which has been battered by the Iran war and resulting surge in energy prices.

Nvidia and Tesla shares advanced 2.3% and 2.7%, respectively. The meeting occurs amid China’s warnings regarding U.S. arms sales to Taiwan and criticism over proposed legislation that would make it harder for Chinese chipmakers to ⁠produce AI semiconductors.

“President Trump took almost a small army with him to meet with the Chinese leaders and President Xi,” Detrick said. “With all the negative news about Iran, he wants to walk away from this meeting in China with potentially some significant deals.”

The Dow Jones Industrial Average fell 67.36 points, or 0.14%, to 49,693.20, the S&P 500 gained 43.29 points, or 0.58%, to 7,444.25 and the Nasdaq Composite gained 314.14 points, or 1.20%, to 26,402.34.

The Toronto Stock Exchange’s S&P/TSX Composite index ended down 249.30 points, or 0.7%, at 34,041.43, after notching on Tuesday its ​highest closing level in three weeks.

Financial stocks were under pressure from a flattening yield curve in the bond market, which may limit banks’ ability to make money from loans. The ​gap between Canada’s 2-year and 10-year yields has narrowed to about 60 basis points from 85 basis points at the start of the year.

Investors have priced in two interest rate hikes from the Bank of Canada after the surge ⁠in oil prices boosted the inflation outlook. Minutes from the central bank’s latest meeting released Wednesday showed that policymakers felt they could afford to be patient on moving rates but that the situation might change quickly.

The financials sector fell 1.1%, with shares of goeasy Ltd ending 5.1% ⁠lower after the consumer lender reported a ​deeper than expected loss.

Shares of e-commerce company Shopify Inc lost 4.5% to ⁠hit their lowest level since May last year, which contributed to 1.1% decline for technology. Shares ‌of Boyd Group Services Inc, which runs autobody and auto glass repair ​facilities across North America, slumped nearly 12% after the company missed analysts’ expectations for first-quarter sales.

The TSX consumer staples sector fell 0.7%, consumer discretionary was down 1.5% and industrials ended 0.9% lower.

On Wall Street, among the 11 major sectors of the S&P 500, communication services and tech enjoyed the largest percentage gains, while utilities were the biggest laggards.

Morgan Stanley raised its annual ⁠target for the S&P 500 index to 8,000 from 7,800, saying U.S. stocks have enough ​room to rally as companies continue to post strong earnings.

Ford surged 13.2%, its biggest one-day percentage jump in six years, after Morgan Stanley called the automaker’s energy business ⁠and its partnership with Chinese battery giant CATL an “underappreciated” competitive advantage.

Nebius Group jumped 15.7% after the AI cloud firm reported a nearly eightfold rise in quarterly revenue.

EchoStar climbed 3.0% the day after the ‌Federal Communications Commission’s approval of the $40 billion sale of wireless spectrum to SpaceX and AT&T.

Cryptocurrency firms Coinbase and Strategy slid 2.8% and 3.5%, respectively, dragged down by ​weakness in bitcoin and ethereum.

Declining issues outnumbered advancers by a 1.21-to-1 ratio on the NYSE. There were 433 new highs and 175 new lows on the NYSE. On the Nasdaq, 2,273 stocks rose and 2,450 fell as declining issues outnumbered advancers by a 1.08-to-1 ratio. The S&P 500 posted 37 new 52-week highs and 46 new lows while the Nasdaq Composite recorded 119 new highs and 191 new lows.

Volume on U.S. exchanges ​was 19.03 billion shares, compared with the 18.12 billion average for the full session over the last 20 trading days.

Reuters, Globe staff

Follow related authors and topics

Authors and topics you follow will be added to your personal news feed in Following.

Interact with The Globe