Amazon released its earnings report for its second fiscal quarter after closing bell tonight, posting earnings of 19 cents per share on revenue of $23.18 billion. Analysts had been expecting losses of 13 cents per share on $22.39 billion in revenue, a 20% increase year over year. In the same quarter last year, Amazon reported losses of 27 cents per share on revenue of $19.34 billion.

Amazon.com, Inc. Surges After Posting Surprise Profit

Key metrics from Amazon’s earnings report

Amazon recorded a 69% increase in operating cash flow, which rose to $8.98 billion for the trailing 12 months. For the same period a year ago, operating cash flow was $5.33 billion. Free cash flow increased from $1.04 billion for the 12 months ending June 30, 2014 to $4.37 billion for the trailing 12 months ending June 30, 2015. Operating income was $464 million, compared with last year’s $15 million operating loss. Net income was $92 million, compared with last year’s net loss of $126 million.

Among Amazon’s highlights during the quarter was its first Prime Day on July 15, and the company reported that more new members tried its Prime service than any other single day in its history. Also customers bought more items on Prime Day than they did on Black Friday 2014. Also sellers participating in Fulfillment by Amazon saw record-breaking sales on that day. Overall, Amazon had quite a busy quarter, as outlined by Founder and CEO Jeff Bezos:

“We unveiled Amazon Business, opened Amazon Mexico, launched Prime free same-day, rolled out our ninth Prime Now city, broke our Black Friday record with the first-ever Prime Day, received 11 Emmy nominations for Transparent, debuted six new kids pilots, brought Echo to general availability, introduced the Alexa Skills Kit and Alexa Voice Service, opened FBA Small and Light, continued to double down on our fastest growing geography — India, launched 350 significant AWS features and services so far this year (ahead of last year’s pace), introduced AWS Educate, and entered into agreements for new solar and wind farms — enough to exceed our 2016 goal of 40% renewable energy.”

Amazon provides guidance

For the third quarter, Amazon management expects net sales to be between $23.3 billion and $25.5 billion, which is a growth rate of 13% to 24% year over year. They’re expecting operating income to be between a loss of $480 million and income of $70 million. In last year’s third quarter, Amazon posted an operating loss of $544 million.

As of this writing, shares of Amazon were up 17% at $564.15 per share in after-hours trades.