The online retail giant reported a $92m profit compared to a $126m loss for the same period a year ago.
According to The BBC, sales also rose 20 per cent to $23.2bn in the second quarter to the end of June, boosted by strong growth in the US.
Its shares, which fell 1.3 per cent during the day, leapt 18.5 per cent to $571.24 a share in after-hours trading on Wall Street.
The firm was also upbeat on its prospects for the current third quarter, forecasting sales would grow between 13 per cent and 24 per cent compared to last year, much higher than analysts had predicted.
Sales in North America rose 25.5 per cent to $13.8bn in the second quarter, driven by purchases of electronic goods and general merchandise, helping to drive the strong performance.
Its cloud computing division, Amazon Web Services, also made a contribution, with sales up 81 per cent compared to the same quarter last year.
It said its widely promoted “Prime Day” on 15th July – which offered special deals to customers who signed up to its fast delivery service – had been a success with more new members trying it globally than any other day in the firm’s history.
Amazon founder and chief executive Jeff Bezos credited hard work for the results: “The teams at Amazon have been working hard for customers,” he said.
Throughout its history, Amazon’s revenue has climbed while its profit has hovered around or below zero.
On Thursday evening, the e-commerce company reported a profit.
As customers in North America bought electronics and others products, sales in its biggest market rose more than 25 per cent compared to last year.
And if you thought Microsoft’s cloud computing business did well, then take a look at Amazon web services which includes its cloud business – revenue soared more than 80 per cent.
The only slight negative was that sales growth outside the US wasn’t nearly as impressive.
Still after years of ploughing its cash into new technology, mostly aimed at making it easier and faster for customers to get