Apple (AAPL -1.92%) just released its quarterly earnings results, and the company says it sold 31.2 million iPhones, a record for the quarter, and 14.6 million iPads last quarter.

The iPhone number compares to 26 million in the year-ago quarter, a 20% increase. The iPad number compares to 17 million in the year-ago quarter, a 14% drop. The company sold 3.8 million Macs in the quarter, compared to 4 million in the year-ago quarter.

Total revenue came in at $35.3 billion, which translated into $6.9 billion in net income, or $7.47 per share. Both top- and bottom-line figures topped the Street's best guesses. iPhone unit sales in particular were much better than expected, which helped ease the pain of weaker-than-expected iPad unit sales.

For the coming quarter, the Mac maker's guidance calls for sales in the range of $34 billion to $37 billion, with gross margin of 36% to 37%. The company also declared a quarterly dividend of $3.05 per share, the same amount it declared back in April. CFO Peter Oppenheimer noted that Apple has now returned a total of $18.8 billion in cash to shareholders through dividends and share repurchases.

Investors were pleased with the results, as shares are up 5% in after-market trading.

link