Amazon has long focused on spending the money it makes to grow its business and expand into new areas, from movie streaming to e-readers and even grocery delivery.
Investors have largely forgiven thin profit margins and zeroed in on the company's solid revenue growth and long-term prospects. It posted losses in two previous quarters due to rising operating costs.
Amazon said Thursday that it earned $239 million, or 51 cents per share, in the October-December period, which included the key holiday shopping period. That's up from $97 million, or 21 cents per share, in the same period a year earlier.
Revenue grew 20 percent in the fourth quarter, to $25.59 billion from $21.27 billion.
Analysts were expecting earnings of 74 cents per share on revenue of $26.05 billion, according to FactSet.
For the current quarter, Amazon is forecasting revenue of $18.2 billion and $19.9 billion. Analysts expect $19.67 billion.
Shares of Seattle-based Amazon.com Inc. fell $32.27, or 8 percent, to $370.74 in extended trading after the results came out. The stock had closed regular trading up $18.81, or nearly 5 percent, at $403.01.