The firm's per-share earnings of $5.07 were more than double analysts' estimates of $2.49, and it had the highest quarterly profit in its history of $2.5 billion.
Shares of Amazon surged 3.5% to $1,872 in after-hours trading on the back of the outperforming results.
Amazon's (AMZN) profits jumped in the second quarter despite sales falling short of Wall Street forecasts, topping $2 billion for the first time.
Meanwhile, Amazon Web Services, the company's cloud-computing business, saw sales jump 49% from the second quarter past year, to $6.11 billion. Sales picked up speed from the year prior, too, rising 49 percent to $6.1 billion and beating the average estimate of $6 billion.
Following the disappointment Wednesday in Facebook's stalling growth in users and engagement in key markets, which led to a almost 20% drop in its stock price and over $100 billion in market cap, Amazon regained a small drop during trading hours to return to its previous day's close in after-hours markets. The company drew $1.64bn in operating income off $6.1bn in AWS revenues, compared to $1.83bn in operating income off $32.1bn in North American net sales. The company's brick-and-mortar stores generated $4.31 billion in second-quarter revenue.
'A big contributor to the quarter and the last few quarters obviously has been strong growth in our highest profitability businesses and also advertising, ' Amazon CFO Brian Olsavsky said on a call with analysts.
Amazon's total costs increased almost 37 per cent in the three months ending in June to $49.9bn, as the firm invested heavily into its premium service Prime across its online video, warehouse and delivery infrastructure.
Key to its allure has been that advertisers' placements result directly in sales, reaching customers on Amazon with an intent to shop.
Amazon will capture almost half of all online spending in the US this year, according to EMarketer Inc.
Amazon's stock has more than tripled in the past three years, making Chief Executive Officer Jeff Bezos the richest person on the planet.
Younger, higher-earning businesses, including cloud computing and advertising, along with a July event the company created to drum up sales during the summer shopping lulls, are helping Amazon overcome high costs in the third quarter.
There still seems to be room for Amazon to grow its advertising business even more. But as online sales grew, so did shipping costs: Amazon spent almost $6 billion mailing out packages in the second quarter, a 31 percent increase from a year ago.
Facebook just released earnings this week and reported $13 billion in ad sales in the second quarter.
Amazon has more than 100 million Prime subscribers who pay yearly or monthly fees in exchange for fast shipping, video and music streaming and digital photo storage.
Another point worth calling out regarding Amazon's second quarter: 53% of paid unit growth came from third-party sellers, up from 52% in Q1 and up from 51% in Q2-2017.