Amazon.com (AMZN) disappointed Wall Street on Thursday by disclosing an unexpected second-quarter loss amid rising expenses and currency issues and issuing cautious revenue guidance for the third quarter.

Shares of the online retail giant dropped about 3% on the weaker-than-expected results.

Amazon.com said it lost $7 million, or 2 cents a share, compared with a profit of $7 million, or 1 cent a share, a year earlier. Analysts had been projecting a profit of 5 cents a share.

Revenue jumped 22% to $15.70 billion, narrowly missing the Street’s view of $15.73 billion. North American sales climbed 30% to $9.50 billion, while international revenue increased 13% to $6.21 billion.

Amazon.com's gross margins expanded to 28.6% from 26.1%, beating forecasts from analysts for 27.4%.

The company was hurt by rising operating expenses, which increased 3% to $15.63 billion last quarter.

Hurt by unfavorable foreign-exchange fluctuations, Amazon.com said its operating income slumped 26% year-over-year to $79 million. That was well above the Street's view of $51.8 million and the company’s guidance for a loss of $340 million to a gain of $10 million.

Operating cash flow soared 41% to $4.53 billion for the trailing 12 months, while free cash flow plunged 76% to $265 million over that span.

Amazon.com warned it expects to post an operating loss of between $65 million and $440 million, which compares unfavorably with forecasts for a gain of $71.1 million. Management said sales are seen ranging between $15.45 billion to $17.15 billion, the midpoint of which is below estimates on Wall Street for $16.98 billion.

Non-GAAP operating income is seen ranging between a loss of $100 million and a profit of $275 million, which is below the Street’s view of $402 million.

Wall Street punished Seattle-based Amazon.com for the latest news, driving its stock down 2.10% to $294.03 in after-hours trading.

Follow Matt Egan on Twitter @MattMEgan5