Apple posted a quarterly profit that blew past Wall Street forecasts thanks to strong sales of Mac computers and improved margins, sending its shares higher in extended trading Tuesday.
Apple said it earned $1.35 a share in its fiscal third quarter, excluding one-time items, on sales of $8.34 billion. That compares with $1.19 a share on sales of $7.46 billion in the same period last year.
Analysts who follow Apple expected the company to turn in a gain of $1.17 a share on sales of $8.2 billion, according to a consensus from Thomson Reuters.
"Obviously it's a phenomenal beat, particularly on the bottom line, printing $1.35. We were at $1.17," said Daniel Ernst, analyst at Hudson Square Research. "It demonstrates operating efficiencies. Most of the numbers were better than expected, particularly the Macs."
Apple shares , which closed Tuesday 0.91 percent lower at $151.51, were up almost 4 percent in extended trading. Get after-hour quotes for Apple here.
Analysts had some concern heading into the earnings about margin pressure, given price cuts on the iPhone and the trend of higher component costs.
But Apple posted a gross margin of 36.3 percent, which beat the 34 percent that some analysts had predicted. That compared with 36.4 percent in the last quarter and 34.8 percent a year ago.
The results demonstrated the consumer appeal of Apple's products despite a troubled world economy that has dented sales at competitors selling less expensive products. Investors have snapped up Apple's stock this year, pushing it up at a pace well ahead of other big technology issues.
Video: CNBC's Jim Goldman and the Fast Money traders discuss Apple's excellent quarter.
Sales of Macs and iPhones beat expectations in the June quarter, while iPod sales were toward the low end of forecasts.
Apple said it sold 2.6 million Macs, up 4 percent from a year ago, benefiting from a refresh last quarter and lower prices on laptops. It sold 5.2 million iPhones in the June quarter, during which it had launched its third-generation iPhone 3GS and cut the price on the second-generation model to $99.
It shipped 10.2 million iPods, down 7 percent year on year.
Apple issued a typically conservative outlook for the current quarter, forecasting earnings of $1.18 to $1.23 a share on revenue of $8.7 billion to $8.9 billion.