Amazon blows estimates away. Stock surges.

NEW YORK (CNNMoney) -- Amazon's been spending lots of money on expanding its operations, so analysts expected a huge drop in profit for the first quarter. And even though earnings did fall, they didn't decline nearly as much as analysts had feared.

Amazon (AMZN, Fortune 500) earned $130 million, or 28 cents per share for the quarter that ended March 31. That was a 35% decline from a year ago, but it was much better than the 7 cents per share forecasts from analysts polled by Thomson Reuters.

Amazon's revenue came in at $13.2 billion, just above the $12.9 billion that analysts expected. The company's guidance for its second quarter was in line with expectations, with Amazon forecasting sales of between $11.9 billion and $13.3 billion for the second quarter. Analysts were looking for about $12.8 billion

Amazon often sets a laughably wide range for its operating income outlook, and this report was no exception. Amazon predicts its operating income for the current quarter will come in the range of a $260 million loss to a $40 million profit.

Profit slipping: While Amazon's sales have been growing at an impressive clip, there are worries about how much Amazon's investments are eating into profits.

One high profile investment came last month, when Amazon announced it's buying Kiva Systems for for $775 million. Kiva makes bright orange robots that scuttle around warehouses filling orders. Once the all-cash deal closes, it will be Amazon's biggest acquisition since its purchase of Zappos in 2009.

On a post-earnings conference call, Amazon CFO Tom Szkutak said the company plans to continue expanding.

"Given the growth that we're experiencing right now, we're investing and we're making sure we have the resources to do that," he said.

Investors and analysts have also been concerned about Amazon's low profit margins. Amazon forgoes profit in some businesses in order to buy market share -- that is, the company often sells key products for less than they're worth at first, and worries about making money later.

That's the model Amazon uses for the Kindle Fire, a $199 tablet-lite that went on sale in November. Amazon actually loses a few dollars on the production of each Fire -- but it's willing to get tablets into customers' hands for cheap, with the goal of making money from selling content like e-books and digital music.

Spotlight on Kindle: Sales of all Kindle units increased 43% over the same period last year, Amazon said Thursday. But Amazon famously does not release figures for the actual number of Kindle models sold.

One analyst dared to ask for some Kindle details while on the conference call, but Szkutak declined to answer.

The Kindle Fire's low price point is meant to attract more casual customers who aren't willing to shell out hundreds of dollars for an Apple (AAPL, Fortune 500) iPad, Motorola (MMI) Xoom or Samsung Galaxy Tab.

Meanwhile, one of the Kindle's main rivals is in turmoil. Earlier this year, Barnes & Noble (BKS, Fortune 500) said it is considering spinning off its Nook e-reader business. The Nook is about the only bright spot for Barnes & Noble; in the same announcement, the company slashed its outlook for fiscal 2012.

Amazon's main tablet competitor, Apple (AAPL, Fortune 500), also reported earnings this week. Apple doubled its profit last quarter, boosted by solid demand for its newest iPad tablet as well as stronger-than-expected sales of its iPhone.