For the fiscal quarter ended 26 September, Apple earned $9.87bn in revenue, up 25% year on year from $7.8bn. Analysts had been expecting revenue between $8.74bn and $10.55bn.
Apple sold 3.05 million Macintosh computers during the quarter, up 17% on a year ago, and 10.2 million iPods, down 8%.
The company sold 7.4 million iPhones in the quarter, up 7% year on year, and doubled the sales of iPod Touches.
Apple's iPhone sales were boosted by the unveiling of the 3GS in June, at which time Apple also cut the price of the phone's previous generation, 3G.
Steve Jobs, chief executive of Apple, said: "We are thrilled to have sold more Macs and iPhones than in any previous quarter. We've got a very strong lineup for the holiday season and some really great new products in the pipeline for 2010."
Following the positive results, Apple's share price hit an all-time high, rising by more than 7.5% to above $204 in extended after-hours trading. The company's previous high was $202.96 in December 2007.
For its full fiscal year Apple said it increased revenue by 12% to $36.5bn, and net profit by 18% to $5.7bn.
Peter Oppenheimer, Apple's chief financial officer, said: "Looking ahead to the first fiscal quarter of 2010, we expect revenue in the range of about $11.3bn to $11.6bn and we expect diluted earnings per share in the range of about $1.70 to $1.78."
Apple said the iPhone will go on sale in China later this month, ahead of the busy Christmas period.