Apple has become only the second company in history to surpass the $5 trillion market valuation mark, reclaiming the title of the world’s most valuable company from chipmaker Nvidia as investor sentiment shifts away from AI infrastructure spenders.

The iPhone maker’s shares hit a session high of $342.89 on Tuesday, giving it a market capitalisation of $5.04 trillion (£3.78tn), before easing back to trade 0.64% higher at $339.71 – around the $4.98tn mark. The milestone comes after Apple overtook Nvidia earlier this month, ending the chip giant’s near-year-long reign atop the global stock market.

Nvidia, which became the first company ever to breach the $5tn threshold in October, saw its market value drop by 3.5% in recent trading, leaving it at approximately $4.86 trillion – slightly below Apple’s $4.88 trillion valuation at the time of the overtaking, according to figures cited by multiple reports.

The changing of the guard reflects a broader reassessment among investors about who benefits most from the artificial intelligence boom. After a prolonged period of rewarding companies that build AI models and the semiconductors that power them, the market is now pivoting toward firms that can turn compute into consumer-ready experiences.

“Market sentiment has shifted from rewarding model makers, then to semis, and now on to those companies that can turn compute into experiences and outcomes the customer will pay for, thus driving corporate earnings,” Michael Monaghan, founder of Founder ETFs, told Al Jazeera. “Apple investors first questioned Apple’s lower AI spend, but now have treated Apple’s lower AI capital expenditure as an advantage, with the bull case being that Apple benefits from consumer AI without spending at cloud-infrastructure scale.”

Toni Meadows, head of investment at BRI Wealth Management, echoed that view: “Apple was seen as a laggard in the AI race because it wasn’t spending to develop models, but now sentiment has changed. Apple is less exposed to capex intensity and better positioned to monetise AI via services, ecosystem lock-in, and hardware upgrades. The re-rating reflects confidence in earnings durability rather than speculative AI upside.”

Apple’s rally has been driven as much by strong product demand as by its decision to sit out the AI spending race that is weighing on cash flows at big tech rivals. The company has also benefited from holding iPhone prices steady, despite increasing prices for MacBooks and iPads last month.

Last month, Apple unveiled a revamped version of its assistant, Siri AI, which enables the personal assistant to better understand the personal context of users’ questions, access real-time information from the web, and perform more complex tasks on behalf of users. The overhaul, long delayed, is seen as a bid to close the gap with Big Tech rivals in the crucial AI race.

Some analysts believe Apple is sitting on an AI gold mine in the form of the personal data stored on every iPhone. That data could make Siri’s answers more useful and the assistant more capable. The challenge, they note, is that such data is locked away in operating systems in the name of privacy, and the company would have to find a way to unlock its value.

The valuation milestone comes as CEO Tim Cook prepares to hand over the reins to hardware veteran John Ternus in September, a transition that could shape how his final months at the helm are viewed. The shift in investor sentiment may also be a factor in how the company is perceived as it enters a new leadership era.

Apple’s surge comes amid an intensifying sell-off of AI and semiconductor stocks worldwide. US chip stocks extended their recent losses on Tuesday, with Intel, Advanced Micro Devices, Sandisk, Western Digital Corp and Seagate Technology all down by more than 4%. The Nasdaq 100 index of leading tech stocks fell by as much as 1.8% at one point, meaning since its early June record high it had fallen more than 10% – the technical definition of a market correction.

Analysts attributed the sell-off to renewed worries over AI investment spending and competition from cheaper Chinese companies, after a report by the Information that China had begun mass production of homegrown deep ultraviolet (DUV) chip-making tools. The Philadelphia SE Semiconductor index also declined, reflecting the broad weakness in the sector.

South Korea’s stock market slid to its lowest level since mid-April, with semiconductor companies SK Hynix and Samsung Electronics falling by more than 10%. Investors may also be growing jittery about the “circular funding” at the heart of the AI boom, where tech giants borrow heavily to fund datacentre expansion.

Apple’s ability to reach the $5tn mark despite the broader tech sell-off underscores its unique position as a consumer company that benefits from AI without bearing the heavy capital costs of building and running massive AI infrastructure. As the market recalibrates its expectations for AI, the race for the world’s most valuable company may continue to see shifts between the two tech titans.

The company is scheduled to release its third-quarter earnings on July 30, which could provide further clarity on how its AI strategy is translating into financial performance. Last quarter, Apple executives forecast sales growth of 14% to 17%.