Apple sold essentially the same number of iPhones last quarter as it did a year prior, but sales and profits soared as it made more money from higher-priced devices.

 

Apple said that its profit had jumped more than 30 percent to $11.5 billion in the recently ended quarter, besting market expectations despite selling fewer iPhones than analysts projected.

The news boosted shares in the tech giant in after-hours trading, putting it ever closer to a history-making, trillion-dollar market value, even as China's Huawei knocked Apple off second spot in a tightening global smartphone market.

Apple's revenue in the fiscal third quarter soared 17 percent to $53.3 billion from the same period a year earlier on the back of sales of pricier iPhones, online services and wearable devices.

"We're thrilled to report Apple's best June quarter ever, and our fourth consecutive quarter of double-digit revenue growth," chief executive Tim Cook said in the earnings release.