In this Wednesday, Nov. 28, 2018, file photo Microsoft CEO Satya Nadella listens to a question as he sits in front of the Windows logo during the annual Microsoft shareholders meeting in Bellevue, Wash. Microsoft, the 1990s home-computing powerhouse that is having a renaissance moment, has eclipsed Amazon and is close to passing Apple in market value.

A funny thing happened in the competition to be the most valuable public company in the U.S.

Apple became the first U.S. company valued at $1 trillion in August, and Amazon briefly joined it a month later. With Apple selling phones for more than $700 a pop, on average, and more and more consumers shopping on Amazon, it was no surprise that those companies rose to the top of the value chain.

Then came October and November. Both companies issued cautious outlooks for the holidays amid a downturn in the stock market and investors dumped their shares, opening the door for a third player.

Microsoft, the 1990s home-computing powerhouse that is having a renaissance moment, has eclipsed Amazon and is close to passing Apple in market value. Around midday Thursday, Apple’s value topped Microsoft’s by just over $2 billion: $847.6 billion to $845.2 billion. Amazon was back to $820.8 billion.

That Microsoft is even close to eclipsing Apple would have been unheard of just a few years ago.

But under CEO Satya Nadella, Microsoft has found stability by moving away from its flagship Windows operating system and focusing on cloud-computing services with long-term business contracts.

Microsoft even momentarily passed Apple in value on Monday, the first time in eight years it was more valuable than the iPhone maker. Apple has been the world’s most valuable firm since claiming the top spot from Exxon Mobil earlier this decade. Microsoft hasn’t been at the top since the height of the dot-com boom in 2000.

Wall Street analysts are encouraged by Microsoft’s growing cloud-computing business while a bit concerned about a slowdown in Apple’s phone sales. Research firm Canacord Genuity lowered its price target for Apple to $225 from $250 on Thursday, while maintaining a “buy” rating. Apple shares have fallen from around $225 in early October to below $180.

Related Articles

That 21 percent decline has allowed Microsoft to again be a contender for most valuable company. Microsoft shares have dropped only 4 percent in the same time frame, a reflection of its steady focus on business customers in recent years.

Being less reliant on consumer demand helped shield Microsoft from holiday season turbulence and U.S.-China trade war jitters affecting Apple and other tech companies.