With upbeat forecast for the third quarter, coupled with positive sentiment voiced by company executives over its Prime delivery service and rapid growth in its cloud computing service, Amazon cheered Wall Street posting reporting a profit of $92 million for the second quarter.
The profit, amounting to 19 cent per share, for the second quarter ended 30th June, as against a loss of $126 million, or 27 cent per share, a year earlier.
Revenue was up 19.9 per cent to $23.19 billion. On average analysts had projected a loss of 14 cent per share and revenue of $22.39 billion.
Seattle-based Amazon, last reported a profit in the 2014 fourth quarter and investors have often expressed concerns that its heavy spending on new ventures would not actually pay off.
"My quick take is that management has a lot of discretion over spending and appears to understand that investors prefer profits to losses," said Michael Pachter, analyst at Wedbush Securities, Reuters reported. "If they keep delivering profits, the stock should work."
Amazon's shares had languished for much of last year with the company failing to deliver sustainable profits. The shares were down to as low as $284 last October, virtually half of the price reached in after-hours trade yesterday.
Prime, which for $99 a year also offered exclusive access to certain movies, music and Kindle books, was getting new subscribers at rates "higher than we've ever seen," chief financial officer Brian Olsavsky told analysts on a conference call.
Membership was growing faster outside the US than inside, partly helped by a recent one-day sale event called "Prime Day," according to Amazon.
Amazon.com's unexpected quarterly profit on higher sales in North America, sent the retailer's shares up more than 17 per cent, pushing it to $566.02 in after-hours trade, creating market value above Wal-Mart's $233.52 billion.
Sales in North America, the company's biggest market, were up 25.5 per cent to $13.8 billion in the second quarter from a year earlier, helped by robust demand for electronics and general merchandise.
Cloud-computing revenue shot 81.5 per cent to $1.82 billion, making up nearly 8 per cent of the quarter's revenue.
The company forecast net sales would grow 13 per cent to 24 per cent, to a range of $23.3 billion to $25.5 billion, in the third quarter. This is well above analysts' consensus estimate of $23.89 billion.