Apple made more money from higher priced iPhones in the latest quarter, even as the number of phones it sold did not change much.
The sluggish unit growth means Apple is no longer the second-biggest smartphone maker behind Samsung. Huawei took that spot, research firm IDC said Tuesday, with 54.2 million phones versus Apple's 41.3 million.
The company's earnings were announced amid escalating rhetoric around tariffs between the U.S. and China. CEO Tim Cook said that while the company's products hadn't been hurt by tariffs imposed so far, Apple is still examining the impact of proposed U.S. tariffs on $200 billion worth of Chinese goods. Cook said he's "optimistic" the countries will work out their differences.
"Each country can only prosper if the other does," he said.
Despite the trade war, China remains one of Apple's best markets, posting double-digit revenue growth in the country for the fourth quarter in a row, Cook said.
Globally, higher selling prices for devices like the iPhone X and iPhone 8 pleased Wall Street analysts. They expect even bigger, fancier iPhones heading into the holidays.
Shares of Apple rose 4 percent after-hours Tuesday.
Cook also said he wasn't fazed at the maturity of the smartphone market, which IDC said shrank 2 percent 342 million units in the quarter.
"Whether it grows 1 percent or 2 percent ... or shrinks 1 or 2 percent, it's a great market because it's just huge," Cook said.
Apple unit sales rose just 1 percent from a year ago, which was expected, but the average selling price grew 20 percent to $724 per iPhone, up from $606 a year ago.
Cook said its premium iPhone X, which starts at $999, was the most popular iPhone in the quarter, despite being a few hundred dollars more than previous iPhones.
It features a brighter screen that spans the device from edge to edge and boasts facial recognition technology. Apple's newer base models — the iPhone 8 and 8 Plus — also had $50 and $30 price increases compared with their predecessors.
Revenue from the app store, music subscriptions and other services grew 31 percent to $9.5 billion, a record for Apple. Apple Music subscribers exceeded 50 million.
Apple also reported a 37 percent increase, to $3.7 billion, in the division for miscellaneous hardware, including Apple Watch and the HomePod smart speaker. But Apple saw revenue declines in both the iPad and Mac computers.
"Apple is no longer a one-trick pony," said Daniel Morgan, a portfolio manager with Synovus Trust Company, citing higher iPhone prices, a growing cash hoard, and increased services revenue.
Its net cash stood at $129 billion, according to Moody's analyst Stephen Sohn.
Cupertino, California-based Apple said net income rose 32 percent to $11.52 billion, or $2.34 per share, beating the $2.17 expected by analysts.
Revenue rose 17 percent to $53.27 billion, also exceeding Street forecasts for $52.37 billion.
For the current quarter ending in September, Apple said it expects revenue of $60 billion to $62 billion. Analysts surveyed by Zacks had expected revenue of $58.59 billion.