Thought Apple earnings don’t offer any surprises anymore? Think again. The company unexpectedly grew its iPhone sales year-over-year during its most recent quarter, which contributed to results that beat analysts’ expectations.

Apple generated $45.4 billion revenue in its fiscal third quarter, which ended on June 30, compared to $42.4 billion a year ago. The company’s net income for the quarter was $1.67 per diluted share. Analysts had expected revenue to come in at $44.49 billion, with earnings per share of $1.56.

Apple’s growing iPhone sales are especially significant because Q3 is traditionally a weak quarter for the company, with consumers holding off on any new phone purchases until the company releases a new model in September.

And this time around, they would have had even more reasons to wait, as leaks have pointed to a significant redesign for the Phone, which may ditch the physical home button and feature facial detection to unlock the device. However, consumers still bought more than 41 million iPhones, compared to 40.3 million a year ago.

This also means that the company has been able to turn around a trend of declining sales for its smart phone, which have depressed results over the past several quarters.

But the iPhone wasn’t the only success story in the company’s line-up. Sales of iPads were also up significantly, to the tune of 15% in units. That’s the first such sales growth for iPads in four years. However, revenue for iPads was up just 2%, suggesting that buyers have been gravitating to cheaper models.

The company’s services business grew 22% year-over-year, and now totals close to $7.3 billion. This segment includes App Store sales, but also subscriptions to Apple Music. Apple CEO Tim Cook called these results “an all-time quarterly record for Services revenue.”

Apple said Tuesday that it expects to generate between $49 billion and $52 billion next quarter, suggesting that it sees a lot of demand for the next iPhone model. Investors thanked the company for this by sending up its stock more than 6% after markets closed.