Amazon surprised the market Thursday with a quarterly profit far better than anticipated for the online giant known for investing for the long term.
Amazon posted earnings of $214 million in the fourth quarter as sales jumped 15 percent to $29.3 billion, swinging to profit after two consecutive losing quarters.
Shares in Amazon shot up 7.8 percent to $336.20 in after-hours trading following the release.
The profit adjusted for special items amounted to 45 cents per share, well ahead of the consensus Wall Street estimate of 17 cents.
Amazon has faced pressure from shareholders to deliver profits even as founder Jeff Bezos has invested in a vast array of projects -- from online video to its own smartphones; delivery drones to business email.
For the full year 2014, Amazon posted a net loss of $241 million on sales of $89 billion.
Bezos said the company is reaping benefits from "Amazon Prime," a subscription service which provides free shipping, access to online video and music and other benefits. The price was raised last year to $99 annually for US customers.
"The data is in and customers agree -- on a base of tens of millions, worldwide paid membership grew 53 percent last year -- 50 percent in the US and even a bit faster outside the US," said Bezos, without disclosing detailed figures.
"Prime is a one-of-a-kind, all-you-can-eat, physical-digital hybrid -- in 2014 alone we paid billions of dollars for Prime shipping and invested $1.3 billion in Prime Instant Video. We'll continue to work hard for our Prime members."
Amazon managed the profit even as it ramped up its video offerings to compete against Netflix and others, with its own programming including the series "Transparent," which won a Golden Globe.
At the same time, Amazon has been working to boost sales from its traditional online marketplace and a large cloud services operation for businesses.
But Amazon is also facing increased competition globally with China's Alibaba expanding following a record-setting share offering last year.