After touting earlier this month its best holiday season in history, Amazon (AMZN) revealed disappointing fourth-quarter profit and sales late Tuesday and said it expects sales to be short of expectations in the current quarter as well.

Its shares, however, rallied after hours, climbing more than 10% to $284, led by an improvement in its gross margin to 24.1% from 20.7% a year ago and higher sales.

“Earnings are out and Amazon longs will throw a massive party because gross margin jumped 347 basis points,” said Abe Garver, managing director of BG Strategic Advisors.

The Seattle-based online retail giant reported a 22% increase in sales to $21.27 billion from $17.43 billion a year ago, falling short of average analyst estimates of $22.26 billion in a Thomson Reuters poll.

Excluding the negative impact of foreign exchange rates, Amazon said sales grew 23%.

Net income fell 45% to $97 million, or 21 cents a share, compared with $177 million, or 38 cents, in the year-earlier period. The results missed the Street’s view of 28 cents.

“We’re now seeing the transition we’ve been expecting,” said Amazon CEO Jeff Bezos.

After launching the Kindle five years ago, Amazon said e-books are now a multi-billion dollar market for Amazon and still “growing fast,” up about 70% from last year. Physical book sales, meanwhile, continue to decline, with December booking the lowest growth rate in 17 years.

Amazon launched HD versions of the Kindle Fire Kindle Paperwhite e-reader last fall, helping it to cap off a strong holiday sales season.

Operating expenses, however, continued to grow, with the cost of sales climbing to $16.14 billion from $13.8 billion a year ago.

Shares of Amazon fell more than 2% to $262 initially after hours before bouncing back by more than 10%.

Looking toward fiscal 2013, Amazon said first-quarter net sales are forecast to be between $15 billion and $16.6 billion, representing year-over-year growth of 14% to 26%. Analysts on average are looking for slightly stronger current-quarter sales of $16.86 billion.

Follow Jennifer Booton on Twitter at @Jbooton