The outfit recorded a surprise profit for the second quarter in a row, thanks to higher sales in North America and its cloud computing business.
Amazon has been reining in costs, but it was mostly helped to profitability by growth at its Amazon Web Services (AWS) segment.
Chief Financial Officer Brian Olsavsky told reporters on a conference call that the balance between investing and cost controls "will be lumpy over time."
Net sales from Amazon Web Services, which has more than 1 million active customers in 190 countries, rose more than 78 percent in the quarter to $2.09 billion.
Cloud computing is the fastest growing business for Amazon, and the new services in which it is investing, such as Internet of Things, will help the company capitalize on rising demand to store and manage large amounts of information.
Sales in North America, the largest market for the world's biggest retailer, rose 28.3 percent to $15.01 billion in the third quarter ended September 30 thanks to Prime Day sales and demand for electronics and general merchandise.
In July, Amazon said customers had ordered 34.4 million items worldwide during the one-day sale for members of its $99 per year Prime subscription service.
The company forecast net sales growth of 14 percent to 25 percent, to a range of $33.50 billion and $36.75 billion, for the holiday shopping quarter.
Analysts, on average, had been expecting revenue of $35.16 billion.
For the latest quarter, Amazon reported a profit of $79 million, or 17 cents per share, compared with a loss of $437 million, or 95 cents per share, a year ago.
Total net sales rose 23.2 percent to $25.36 billion. Analysts, on average, had expected a loss of 13 cents per share on revenue of $24.91 billion.