Apple reported an unusual misstep in the April-to-June quarter, selling fewer iPhones than analysts had been expecting, but it wasn't all bad news from Cupertino.

Sales of the iPhone 6 and 6 Plus were 47.5 million units, lower than the roughly 49 million phones that analysts had been expecting the company to sell. That immediately hit Apple shares, which dropped by more than 5 percent in after-hours trading.

But for the quarter, Apple reported sales of $49.6 billion, up by a third from the same period in 2014 and beating its own financial forecast and the elevated expectations of financial analysts who closely follow the company.

Net profit surged by 38 percent to $10.7 billion, also ahead of estimates.

"We had an amazing quarter, with iPhone revenue up 59 percent over last year, strong sales of Mac, all-time record revenue from services, driven by the App Store, and a great start for Apple Watch," said Tim Cook, Apples CEO, in a statement.

Martyn Williams covers mobile telecoms, Silicon Valley and general technology breaking news for The IDG News Service. Follow Martyn on Twitter at @martyn_williams. Martyn's e-mail address is [email protected]