Investors wrapped up an unusual week in the stock market, with surprisingly strong job gains for January and an easing annual rate of consumer-price inflation offset by jitters about artificial intelligence’s capacity to destroy industries.

Worries about this impact from AI were evident during early trading on Friday, when stocks toggled between losses and gains despite a January consumer-price index which showed the annual headline and core rates of inflation dropping — the latter of which fell to a five-year low of 2.5%. By the end of the session, U.S. stocks managed to finish mostly higher, but the Dow Jones Industrial Average DJIA, S&P 500 SPX, and Nasdaq Composite COMP failed to secure weekly gains.Meanwhile, Wall Street’s “fear gauge,” the Cboe Volatility Index VIX, eased after briefly jumping to a one-week high of almost 22 on Friday, up from as low as 17.2 on Thursday and 18 at the start of this week.

‘I feel the clock ticking’: My wife and I are in our 60s — and employ 48 people in a small town. Can we ever retire?

‘I’m a loner’: I’m 62 with a multimillion-dollar portfolio and no heirs. Should I find a wife for my twilight years?

‘We have no prenup’: I want rights of survivorship in our marital home. My wife prefers tenants in common. Now what?

Ahead of Friday’s afternoon trading, the stock market had been more worried about “the fallout from artificial intelligence than reasonably good economic data featuring a strong employment report and satisfactory news on inflation,” said Gary Schlossberg, a global strategist at Wells Fargo Investment Institute in San Francisco. Uncertainty about the impact of AI was “overshadowing or masking the rotation into more traditional sectors.”

Investors have found shelter from this storm in less economically sensitive parts of the market, such as utilities XX:SP500.55, materials XX:SP500.15 and consumer staples XX:SP500.30, which finished higher for the week — suggesting there’s no broad-based loss of confidence in the economy or stock market occurring right now. On a weekly basis, the utilities sector of the S&P 500 logged a 7.1% gain, while materials and consumer staples respectively notched gains of 3.7% and 1.4%. Energy XX:SP500.10, which rose 1.7% over the past five days, has benefited from geopolitical tensions centered on Iran, which have periodically outweighed weak fundamentals tied to oversupply, according to Schlossberg.

Thursday’s trading session handed all three major stock indexes their sharpest daily drops in three weeks, according to Dow Jones Market Data, as fears about AI’s disruptive force swept beyond the tech and software sectors and into industries such as insurance and financial-management services. On Wednesday, equities also got hammered despite January data that showed the biggest job gain in 13 months — which complicates the outlook for inflation and interest-rate cuts by the Federal Reserve.

Read: Dow ends below 50,000 threshold for first time since Friday as AI fears spark wider stock selloff

Also: Stocks have turned volatile despite strong January jobs report. Here’s why investors aren’t happy.

“AI is disrupting a lot of things,” but it’s also doing so based on the expectation of a disruption that hasn’t actually happened yet, said Liz Thomas, head of investment strategy at SoFi. While some companies could end up consolidating or changing their business models, this doesn’t mean entire industries will disappear, she added.

“There’s been this really violent rotation under the surface of equities,” Thomas said, noting the move away from several megacap tech companies and software stocks into other areas of the equity market. The iShares Expanded Tech-Software Sector ETF IGV was down 23.4% on the year through Friday, according to FactSet. It may take a broad “washout” in the tech sector or equities overall for investors to feel more confident that prices have found a bottom, according to Thomas.

Senior portfolio manager Keith Buchanan of Globalt Investments in Atlanta said investors are trying to understand the nuances of “this AI revolution,” particularly when it comes to which companies will be the winners or losers. When market participants were more focused on the economic data than they are now, there was “blind, indiscriminate purchases or trading of some of the largest names,” Buchanan said in a phone interview. “We’ve been wanting more dispersion among equities for a long time, and, being at a firm that thrives on some of that mispricing of individual names, this puts us in a better position to capitalize on some of the dislocations.”

The Dow closed with a 1.2% weekly loss, the S&P 500 finished down by 1.4% over the past five days, and the Nasdaq ended 2.1% lower on the week, according to FactSet.

Joy Wiltermuth contributed.

‘It’s not a sign that it’s going well.’ The median amount American workers have saved for retirement is $955.

Tax refunds are up this year to an average of $2,290, early IRS numbers show. How does yours compare?

Social Security could run out of money in just 6 years — even sooner than originally feared