Apple crushed all expectations for its first-quarter earnings on Tuesday; shares were up nearly 3% after hours in response.

Apple saw $78.4 billion for revenue on expectations of $77.4 billion, and reported earnings of $3.36 per share on expectations of $3.21.

Most importantly, iPhone sales exceeded the high hopes Wall Street had for the quarter, with 78.3 million units sold, on predictions of 76.3 million.

It was Apple’s highest quarterly revenue ever, and iPhone’s biggest quarter ever.

In fiscal 2016, Apple suffered its first annual decline in both revenue and profit since 2001. It was a withering end to the year. Clearly, Apple is starting fresh in 2017, thanks to a smash-hit 2016 holiday season.

“We’re thrilled,” said CEO Tim Cook in a press release. “We sold more iPhones than ever before and set all-time revenue records for iPhone, Services, Mac and Apple Watch… and we are very excited about the products in our pipeline.”

The big number to pay attention to with Apple earnings these days, as Yahoo Finance’s Dan Howley notes, is average selling price (ASP) for iPhone. This time, ASP came in at $694.57, beating the $691 ASP of the first quarter last year, and beating Wall Street expectations of $688.

That’s an all-time high for ASP, indicating Apple devotees bought up iPhone 7 and iPhone 7 Plus, despite the controversy over Apple removing its headphone jack.

Apple hardware sales Q1 2017 More

As for Apple’s other hardware: iPad unit sales fell from 16 million one year ago to 13 million, and iPad revenue fell from $7 billion one year ago to $5.5 billion. Mac unit sales were up just slightly from a year ago to 5.4 million, and Mac revenue rose to $7.2 billion.

Apple’s guidance for the second quarter was a lone dark spot, and it’s the part critics will pounce on. Apple predicts revenue of $51.5 billion to $53.5 billion, just below current expectations of $53.8 billion.

After the disappointing Q4 2016 earnings, Verto Analytics calls this a “turnaround quarter” for Apple. Now, can it continue the momentum through March?

—

Daniel Roberts is a writer at Yahoo Finance, covering sports business and technology. Follow him on Twitter at @readDanwrite.

Read more:

Two weeks with the Nike Apple Watch

Here it is: Apple unveils the Apple Watch Series 2

Here it is: Apple unveils the iPhone 7 and iPhone 7 Plus

Apple’s Eddy Cue on HBO: ‘Television needs to be reinvented’