Amazon significantly beat Wall Street expectations in its second quarter, with revenue of $167.7 billion surpassing analyst forecasts of $162.2 billion and earnings per share of $1.68, crushing expectations of $1.33.

The company's revenue rose 13% year-over-year, though $1.5 billion of that growth came from favorable foreign exchange rates, bringing underlying growth to 12%.

Amazon Web Services (AWS) sales reached $30.9 billion, a year-over-year jump of 17.5%, marginally beating consensus expectations of around $30.7 billion for the cloud computing unit. That's the highest on record, and AWS now accounts for 18% of total revenue. It remains the world's largest cloud provider, dominating about one-third of the global market.

Our AI progress across the board continues to improve our customer experiences, speed of innovation, operational efficiency, and business growth, and Im excited for what lies ahead," said CEO Andy Jassy in a release.

Amazon's North America retail operating income jumped 48% year-over-year, with the segment achieving a 7.5% operating margin that significantly exceeded analysts' 6% prediction, suggesting consumer confidence has remained resilient amid concerns that tariffs on U.S. imports could hike e-commerce prices.

Advertising segments grew by 23%, totally around $15.7 billion in revenue, beating estimates of $14.99 billion, according to StreetAccount.

"The company's vast customer database provides rich material for improving advertising algorithms and targeting, which could drive higher margins through better conversion rates and increased advertiser spending," wrote IG analyst Fabien Yip.

The results show that companies are continuing to use Amazon's cloud services to scale their artificial intelligence ambitions. AWS dominates the market for custom chips for AI, with Trainium and Inferentia used by start-ups such as Anthropic, Runway, and Hugging Face, which utilize them for training large models. AWS is also leading the race when it comes to its AI stack offerings: Amazon Bedrock is considered to be the broadest in the industry, offering access to models from Anthropic, Meta, and Mistral.

Amazon's stock fell 2% during after-hours trading.

While the firm beat analysts' forecasts, its performance has somewhat paled in comparison to Microsoft's stellar quarterly earnings. The tech giant reported revenue growth of 18% on Wednesday, following a 39% year-over-year increase in its cloud business, Azure.

Microsoft continues to reap the rewards of its early bet on OpenAI, having invested $1 billion into the start-up back in 2019. The deal gave Microsoft access to market leader ChatGPT without having to foot the hefty bill costs of training the LLM internally. As per the partnership, Microsoft has built AI tools, such as its Copilot assistant, based on ChatGPT models, and embedded them within its corporate and consumer products. The deal also made Microsoft its exclusive data center provider, an agreement which has proved lucrative as OpenAI's compute needs have soared since its 2022 debut.

By contrast, AWS has been criticized for being slow to the generative AI boom. Its large language models Rufus, a shopping assistant, and Amazon Q, a business and developer-focused assistant have less brand awareness than rival bots such as OpenAI's ChatGPT, Anthropic's Claud, or Google's Gemini.