Amazon.com, reported a drop in profit for the first quarter as its investment in new businesses ate into earnings, but the online retailer's revenue forecast beat Wall Street expectations.

The company also forecast revenue for the current quarter that would beat Wall Street estimates and profit margins were in line with the company's expectations, helping lift its shares in after-hours trading.

The concern that people had, that they were going to spend more than the Street was expecting, happened, said Ken Sena, analyst at Evercore Partners. But when you look at the kind of growth acceleration they are showing on the top line and surpassing pretty much all Street expectations, I think that clearly what they are doing makes sense.

The company has been willing to sacrifice some profitability to win customers and build its new businesses. It has invested heavily in areas such as cloud computing -- which allows companies to store data on its servers -- to take on its rivals Google Inc and Apple Inc.

Amazon is also laying out money to open new distribution centers and cement its lead as the world's largest online retailer.

For the company's first quarter, which ended March 31, revenue was $9.857 billion, above the average estimate of $9.57 billion and 38.2 percent above a year earlier.

Net income in the fourth quarter was $201 million, or 44 cents per share -- down from $299 million, or 66 cents per share, a year earlier. That was far below the 61 cents expected by Wall Street, according to Thomson Reuters I/B/E/S.

The company posted an 18.2 percent dip in operating profit for the quarter, reflecting the costs of competing in the highly promotional retail environment, with beefed-up investment in its cloud computing services.

Operating margin, which Amazon has said is the best gauge of its profitability given the variety of items it sells, came to 3.3 percent, in the middle of the range it had forecast.

But Amazon expects that its investing to win market share will pay off. It forecast current-quarter revenue of $8.85 billion to $9.65 billion, above Wall Street expectations of $8.7 billion, according to Thomson Reuters I/B/E/S.

Amazon said it expects operating profit in the current quarter of $95 million to $245 million. In the same quarter last year, Amazon had operating profit of $207 million.

Amazon shares were nearly flat following the earnings report, after slipping 1.7 percent, or $3.12, to end at $182.30 in regular-session Nasdaq trading.

(Reporting by Phil Wahba; Editing by Gary Hill)