Amazon became only the fifth company in history to top $3 trillion in market value on Monday, as a post-earnings tech rally swept through Wall Street and investors set aside months of anxiety over AI capital spending.

Shares rose as much as 4.6% to an intraday record near $287 before settling around $284, giving the company a market capitalization of roughly $3.06 trillion. Microsoft climbed 5.2% to $488.97 — worth $3.63 trillion — extending a rally that began Thursday when it added nearly $450 billion in market value, the largest one-day gain by any company on record.

The surge followed earnings in which both cloud platforms beat expectations. Microsoft said Azure grew 43% and passed $100 billion in annual revenue for the first time. Amazon said AWS grew 37%, its fastest pace in 18 quarters, and lifted its 2026 capital expenditure forecast to about $220 billion from $200 billion, citing rising memory-chip prices.

The spending is enormous — Microsoft plowed a record $41 billion into capital projects last quarter and flagged more than $50 billion for the current one; Amazon's free cash flow turned negative for the first time since 2023, and Microsoft's fell 23%. But cloud growth and AI demand appear to have appeased investors, at least for now.

"Even at that amount, we will still not have enough capacity to meet all the demand we have in 2026, and I believe this dynamic will also be true in 2027 too," Amazon CEO Andy Jassy told investors. "In fact, the demand we already have for 2028 is striking."

Both companies are running leaner as they race for AI dominance: Amazon has cut about 30,000 corporate jobs since October, including 16,000 announced in January, while Microsoft cut 4,800 jobs in July. Amazon, Microsoft and the three more valuable firms above them — Nvidia, Alphabet and Apple — are now the world's five most valuable companies.