What's happening: Shares of Amazon (AMZN 1.30%) soared on Friday after the company reported its second-quarter earnings Thursday, beating analyst estimates on all fronts. Revenue grew by 19.9% year over year to $23.18 billion, about $790 million higher than the average analyst estimate, while EPS of $0.19 was well above the $0.14 per-share loss analysts were expecting. At 12:15 p.m. Friday, the stock was up about 15%.

Why it's happening: Investors expect Amazon to post strong revenue growth each quarter, and the company certainly delivered. In fact, if currency effects are excluded, Amazon's revenue grew by 27% year over year.

Product sales accounted for $17.1 billion of revenue, up 12.2% year over year, while service sales rose 48.7% year over year to $6.1 billion. Breaking it down into segments, North America sales grew by 20.3% to $13.8 billion, International sales grew by 3% to $7.6 billion, and AWS sales soared 81.5% to $1.8 billion.

On top of the better-than-expected revenue growth, Amazon posted an unexpected profit during the quarter. Operating profit of $464 million, or 2% of revenue, was far higher than the $15 million operating loss the company reported during the same period last year. Net income rose to $92 million, up from a net loss of $126 million during the second quarter of 2014.

The North America segment posted a segment operating income, which excludes stock-based compensation, of $703 million, up from $329 million during the same period last year. The International segment suffered a small $19 million operating loss, but AWS vastly improved its profitability. AWS segment operating income jumped to $391 million, up from $77 million during the same period last year. Total stock-based compensation during the quarter, which isn't allocated by segment, was $563 million.

Amazon also posted growth in its cash flow numbers. Operating cash flow for the trailing-12-month period rose 69% to $8.98 billion, while TTM free cash flow more than quadrupled to $4.37 billion. Amazon's TTM free cash flow excludes an additional $4.7 billion of capital expenditures done through capital leases; if this spending were treated as normal capex, free cash flow would have been negative, not surprising for a company heavily investing in growth.

Amazon continues to deliver exactly what investors want. Revenue grew rapidly in both the North America and AWS segments, and profitability improved considerably compared to the same period last year.