Inc reported a surge in quarterly revenue while profit slipped as the largest Internet retailer benefited from growth in e-commerce but kept spending heavily on distribution, technology and digital content.

The world's largest web retailer reported a 51 percent climb in revenue to $9.91 billion, surpassing Wall Street's expectations for $9.4 billion.

Amazon forecast third-quarter sales of $10.3 billion to $11.1 billion, compared with the average forecast for $10.35 billion, according to Thomson Reuters I/B/E/S.

Shares of the company, which have risen about 18 percent since the start of 2011, gained 4.8 percent to $224.50 in after-hours trade.

Second-quarter net income came in at $191 million, or 41 cents per share, versus $207 million, or 45 cents per share, in the same period a year earlier. Analysts expected 35 cents per share for the latest second quarter, according to Thomson Reuters I/B/E/S.

(Reporting by Alistair Barr, editing by Bernard Orr)