It was a Prime quarter for Amazon.

Amazon surprised investors on Thursday with a fourth-quarter profit that soundly beat expectations, despite a continued increase in spending and a slight sales miss, partly linked to the strong dollar. Investors drove shares up over 8 per cent in aftermarket trading.

The results seem to indicate that areas in which Amazon has been investing in heavily for years, its $99 annual loyalty program and its Amazon Web Services cloud computing offerings for businesses, are finally helping out its bottom line.

CEO Jeff Bezos said Prime membership grew 53 per cent during the year. It doesn't give out total figures. Prime memberships rose though Amazon increased its prices on many goods.

Prime memberships help Amazon get people to engage more often with the company's products — making them likely to spend more, says Morningstar analyst R.J. Hottovy.

Investors have been unhappy

Amazon's strategy always has been to spend a big chunk of the money it makes to grow and expand into new areas like cloud computing, streaming video and hardware — and that has affected profitability to investors' sometime chagrin.

But Thursday's results seem to show the company has the reins in hand when it comes to spending big and being profitable.

Amazon earned 45 cents per share for the three months ended in December, compared to Wall Street expectations of 24 cents per share.

The online retailer posted revenue of $29.33 billion US in the period, which includes all-important holiday sales. Analysts had expected $29.84 billion, but Amazon said the strong dollar pared nearly $900 million from revenue during the quarter as it discouraged shoppers in overseas markets.

For the current period ending in March, Amazon forecast revenue in the range of $20.9 billion to $22.9 billion. 

Amazon shares have increased slightly since the beginning of the year, while the Standard & Poor's 500 index has decreased almost two per cent. In the final minutes of trading on Thursday, shares hit $311.87, a decrease of 19 per cent in the last 12 months.