Amazon.com briefly surpassed both Apple and Microsoft as the world’s most valuable company on Monday, the latest move in what has become a four-way race among tech giants, with Alphabet Inc. not far behind.

After nearly a decade of Apple Inc. dominance, there is an evolving four-way race among the top tech giants that is pitting the cash cow against a trio of cloud-computing colossuses.

On Friday, Microsoft Corp. MSFT, +0.90% MSFT, +0.90% MSFT, +0.90% ended the week as the most valuable company, surpassing Apple AAPL, -0.06% for a title the iPhone maker has held for most of the past seven years. On Monday, Amazon.com Inc. AMZN, +0.46% briefly became the most valuable U.S. public company, before falling back.