Seattle-based Amazon.com Inc. reported a surprise loss in the second quarter, as higher revenue was not enough to make up for rising operating expenses.

The company lost $7 million, or 2 cents per share, in the April-June quarter. That’s down from earnings of $7 million, or 1 cent per share, a year ago.

Stock also fell $8.20, or 2.7 percent, to $295.20 in extended trading after the results came out.

Revenue rose 22 percent to $15.7 billion. Analysts, on average, were expecting earnings of 5 cents per share on revenue of $15.73 billion, according to a poll by FactSet.