The company indicated the investment cycle is likely to continue, as it gave third quarter operating income guidance in the range of a $400 million loss to $300 million profit. Amazon CFO Brian Olsavsky said third quarter typically sees lower operating income because it has to prepare for the holiday peak season. Revenue guidance came in between $39.25 billion and $41.75 billion, right in-line with street estimates of $39.97 billion.

"Third quarter certainly has a healthy amount of investments and we'll continue to grow those areas," Amazon CFO Brian Olsavsky said in a press call on Thursday.

Amazon Web Services remains the company's main growth driver, growing 42% year-over-year, and generating $916 million in operating income. That's more than double the North American business's $436 million in operating income. Its international business continues to lose money with an operating loss of $724 million.

There's been a lot going on at the company. Amazon announced its deal to buy Whole Foods for $14 billion last month. It's also launched a number of new Echo devices, as it's become an unexpected leader in the home voice assistant space. On Thursday, it announced the launch of a new Prime Now service in Singapore as well. It's also looking seriously at the health industry: CNBC reported that the company is exploring opportunities in health care technology and pharmaceuticals.

The results come as Amazon CEO Jeff Bezos briefly surpassed Microsoft cofounder Bill Gates to become the richest person in the world on Thursday. Amazon's stock has been on an absolute tear over the past two years, nearly doubling in price in that period.