NEW YORK (TheStreet) -- Amazon (AMZN) - Get Report crushed analysts' expectations in its second-quarter report on Thursday, sending shares soaring.

The Seattle-based company reported second-quarter revenue of $23.2 billion, up 20% year over year, and earnings of 19 cents per share. Analysts surveyed by Thomson Reuters were expecting Amazon to lose 14 cents a share on $22.4 billion in revenue.

The e-commerce giant provided guidance for the third quarter, expecting revenue of $23.3 billion to $25.5 billion, which would be an increase of 13-24% year-over-year. It expects an operating income or loss of between a $480 million loss and $70 million of income compared to a $544 million loss in the third quarter of 2014.

Analysts were pleasantly surprised by the performance and have been raising price targets across the board. Amazon's new CFO Brian T. Olsavsky had quite the debut.

"We remain heads-down focused on driving a better customer experience through price, selection, and convenience," he said during the earnings call. "We believe putting customers first is the only reliable way to create lasting value for shareholders."

Shares were up 21.74% to $587 in early Friday trading following the company's second-quarter earnings report.

Here are the three key takeaways from Amazon's second-quarter report:

Surprise profit!

Amazon's profit this quarter was all the more surprising since analysts were expecting a loss of 14 cents per share. Gross margins were up to 34.6%, above analyst expectations of 33%

"We believe the combination of accelerating growth and higher-than-expected margins will prove irresistible to investors," Baird analyst Colin Sebastian wrote in a note Friday morning. Sebastian raised his price target for Amazon to $630 from $475.

Some of the factors that may have contributed to Amazon's impressive quarter include the Amazon Web Services business, Prime membership expansion, and growth in Fulfillment by Amazon, the logistics program for third-party sellers. That growth was buffeted by "cost efficiencies from process improvements, fixed asset leverage, and a greater focus on software and algorithms," Canaccord Genuity analyst Michael Graham wrote in a research note on Friday. Graham increased his price target for Amazon to $525 from $400.

"Even though management guided Q3 margins down sequentially, it appears our caution around margin expansion is unwarranted, and we are raising our EPS estimates accordingly," Graham said.

Barclays analyst Paul Vogel similarly admitted his caution was unwarranted.

"For some time, we have believed that Amazon margins would grow slower than bullish expectations and had been concerned with a deceleration in revenue," he wrote in a note on Friday. "Clearly, we have been too pessimistic on the near-term leverage in model as margins are expanding much faster than we thought."

Vogel increased his price target to $700 from $412. "We normally shy away from ratings changes on quarters as we tend to wait for the stock to settle after a big move and then re-evaluate. This quarter was too good in our view to wait and, despite the sizable move in the stock already this year (and aftermarket), we now believe there is even more upside."

AWS Strength

This was the second quarter Amazon broke out specific numbers for its cloud services business, and they sure did not disappoint. Amazon Web Services business brought in $1.82 billion, up 81% year over year.

"You remember that we are lapping a number of large price decreases in Q2 of last year, so it was somewhat expected but a very strong quarter in AWS," Olsavsky said.

Amazon also noted that usage growth outpaced the 81% revenue growth during the quarter.

Olsavsky highlighted the innovation in AWS, saying that the team has added more than 350 new features and services this year.

"Management commented that usage growth was a key driver, growing above the rate of revenue," Cowen and Co analyst John Blackledge wrote in a note Friday morning. "Additionally, results benefited from a more stable pricing environment as AWS lapped year-ago price cuts. Results suggest AWS holds a leadership position in Public Cloud."

Blackledge raised his price target for Amazon to $700 from $565.

Doubling Down on India

India has long been a focus for Amazon, and it seems like that will only continue.

Amazon recently announced that it will be opening an AWS center in India in 2016, which Olsavsky mentioned again during the call.

"What I can say about India is when we see a positive surprise we double down on it," Olsavsky said. "That's kind of our policy, and India is that kind of surprise. So we're very happy, very encouraged early on with what we've seen in the ramping of the business, the level of invention going on for both customers and sellers."

Olsavsky did not detail specifics on the company's investments in India but did mention that improving price and delivery speed in the region were priorities. These investments will likely continue to impact international profitability moving forward.

"India is Amazon's fastest growing e-commerce geography and an area of increased investment," Canaccord Genuity's Graham said.