Amazon Earnings Miss Estimates; Outlook Is Cautious missed analyst expectations for the second quarter and its outlook was cautious as it continues to spend heavily on infrastructure.

Chris Ratcliffe | Bloomberg | Getty Images

Amazon shares initially fell nearly three percent in after hours trading before turning positive. (Click here to get the latest quote for Amazon.)

"The real story here is around guidance — it was a little bit light from what people were expecting, and the bottom line much lower than what people would have expected," Kerry Rice, an analyst at Needham & Co., said.

"A common theme for Amazon is they're going to spend to build the infrastructure and capacity to deliver the products and services to the consumer that they feel the consumer wants," Rice said. "As long as they grow in the high 20s to 30-percent range year over year, they will continue to spend like that."

On the conference call, chief financial officer Tom Szkutak said operating expenses are growing faster than revenue and suggested that this may continue.

"We're investing a lot because of the opportunities we see," the CFO said.

Amazon is spending a lot in the third quarter because it is preparing for the crucial holiday shopping season, he explained. Much of that investment is going into the company's new warehouses; it plans to open 18 this year.

The company also plans to keep investing a lot in video content and technology infrastructure to support its cloud computing and online retail businesses, the CFO said.

For the third quarter, Amazon anticipates an operating loss of between $50 million and $350 million. This guidance includes $275 million for stock-based compensation and other items.

The Internet retailer also forecast revenue of $12.9 billion to $14.3 billion versus Street estimates of $14.1 billion.

Second-quarter net income fell more than 90 percent to $7 million, or one cent per share, from $191 million, or 41 cents per share, in the year-earlier period as it continued to spend and invest in infrastructure.

Revenue rose 29 percent to $12.83 billion, from $9.91 billion a year ago.

Analysts had expected the company to report second-quarter earnings of 2 cents per share on revenue of $12.88 billion, according to estimates from Thomson Reuters.

— Reuters contributed to the report.