Blockbuster growth in Amazon's AWS cloud services unit powered a better than expected rise in quarterly revenue for the group.
Amazon's web retail sales in the United States and internationally, the core of the company's business, also topped expectations, and it forecast revenue ahead of expectations for the third quarter.
Shares of the world's biggest online merchant were up 2 percent in after-hours trading.
"They crushed estimates," said Michael Pachter, analyst at Wedbush Securities.
The cloud business, Amazon Web Services, is the company's fastest growing business and is regarded by analysts as the next driver of growth for the company.
Revenue from AWS surged 58.2 percent to US$2.89 billion. This beat the average estimate of US$2.83 billion, according to market research firm FactSet StreetAccount.
The company's overall net sales rose 31.1 percent to US$30.4 billion in the second quarter ended June 30.
Amazon is riding a wave of retail sales moving to the internet and is using original videos in a Netflix-like service to win new customers - but an expansion in so many areas requires substantial investment.
Shares initially dipped in after-hours trade, as the company forecast relatively low operating income for the current quarter of US$50 million to US$650 million.
It earned US$857 million in the second quarter, or US$1.78 per share, compared with analysts' average estimate of US$1.11 per share, according to Thomson Reuters I/B/E/S.
“It was the largest June quarter profit in the company’s history, but we’re back to guiding barely any profitability,” BGC Partners analyst Colin Gillis said of the September quarter guidance.
Still, that period typically has higher costs for Amazon as the retailer ramps up for the holiday shopping season, Gillis said.
Amazon forecast current quarter net sales of between US$31 billion and US$33.5 billion, factoring in sales from its Prime Day annual shopping festival. Wall Street on average had targeted US$31.6 billion, according to Thomson Reuters I/B/E/S.