Apple once again beat Wall Street expectations in announcing record quarterly results — fueled by the highest revenue from iPhone sales in its history, although it sold nearly 1 million fewer smartphones than in the year-earlier period.

For the company’s fiscal first quarter of 2018 ended Dec. 30, Apple reported revenue of $88.3 billion, up 13% year over year. Net income was $20 billion, with earnings per diluted share of $3.89, up 16% and also an all-time record.

The iPhone X “surpassed our expectations and has been our top-selling iPhone every week since it shipped in November,” Apple CEO Tim Cook said in announcing the results.

For the 2017 holiday quarter, analysts had forecast Apple revenue of $87.06 billion and earnings per share of $3.86.

The iPhone X is the company’s most expensive smartphone ever, priced starting at $999 with 64 gigabytes of storage, with a new facial-recognition ID feature, an edge-to-edge display and a souped-up camera. The device (pronounced “iPhone ten”) actually began shipping in late October, ahead of the official Nov. 3 retail launch.

For the December quarter, Apple shipped 77.3 million iPhone smartphones worldwide, representing $61.6 billion in sales. Unit sales of iPhones were down 1% compared with 78.3 million in the year-earlier quarter, while revenue rose 13%. CFO Luca Maestri noted on a call with analysts that Apple’s fiscal Q1 2018 was one week shorter than the 2016 holiday quarter. Some analysts had expected Apple, which doesn’t break out sales data by iPhone model, to top 80 million iPhone unit shipments.

Meanwhile, Apple issued guidance for its fiscal second-quarter 2018 of revenue between $60 billion and $62 billion — below Wall Street consensus estimates of around $65.7 billion for the current quarter.

According to Cook, Apple in January hit an active installed base of 1.3 billion devices, up 30% over two years. The milestone “is a testament to the popularity of our products and the loyalty and satisfaction of our customers,” he said.

Apple’s services revenue also saw a healthy uptick in the most recent quarter, rising 18% to $8.5 billion. That segment includes iTunes and App Store digital content and services, Apple Music, AppleCare, Apple Pay, licensing and other services. On the earnings call, Cook said Apple Music hit all-time highs for revenue and subscribers in the December quarter but didn’t provide specifics.

Cook also called out Apple’s launch next week of the HomePod wireless speaker. “We’re very happy with the initial response from reviewers,” he said.

Last month, Apple announced it would pay $38 billion in U.S. taxes to repatriate some portion of the cash it holds overseas. As of Dec. 30, 2017, Apple held $285 billion in cash with a total of $163 billion net of debt. Maestri told analysts Thursday that the company expects to be “net-cash neutral over time” and that it would discuss capital-allocation plans following the March quarter.