Amazon 1Q EPS Tops Views, Revenue In-Line (NASDAQ:AMZN) reported Thursday first-quarter earnings that doubled Wall Street estimates, although revenue fell just short of expectations.

The online retail giant posted an $82 million profit, or 18 cents a share, down 37% from a year-ago profit of $130 million, or 28 cents a share. Analysts were looking for per-share earnings of just 8 cents.

Revenue in the first three months of the year rose 22% to $16.07 billion, below estimates of $16.14 billion.

Gross margin widened to 26.6% from 24%.

Amazon has been investing in new warehouses, product development and rights to video content, recently weighing on quarterly results.

In the latest period, operating expenses grew 22% and costs associated with its warehouse and distribution centers rose 39% to $1.8 billion. Amazon’s technology and content costs related to its Kindle devices and licensing for media soared 46% year-over-year to $1.38 billion.

For the current quarter, Amazon forecast revenue of $14.5 billion to $16.2 billion, compared to analysts’ view of $15.9 billion. The company also said it expects operating results to fall between a loss of $340 million and a profit of $10 million.

Shares were trading about 1% higher at $277.20 in after-hours trading.