Apple on Tuesday revealed the results of its fourth quarter of fiscal 2016, in which the company sold 45.5 million iPhones on its way to $9 billion in net income, coming in just slightly ahead of expectations on Wall Street.

Revenue for the quarter reached $46.9 billion, down from $51.5 billion a year ago, but also ahead of market consensus that Thomson Reuters pegged at $46.89. Earnings per share came in at $1.67, also slightly ahead of Wall Street's expectation of $1.65.

As usual, the iPhone was the main cash cow for Apple. The 45.5 million sold were slightly ahead of what investors anticipated, at 4 million.

But the company also spotlighted its services revenue, which grew 24 percent to an all-time quarterly record of $6.3 billion.

One area where Apple's earnings did disappoint relative to expectations was gross margins —  they were at 38 percent, compared to 39.9 percent a year ago.

The conclusion of the fourth quarter marks the first-ever year where iPhone sales declined compared to the prior. iPhone units were down from 48 million in the same period a year ago.

iPad sales for the quarter were 9.3 million, a 6 percent decrease from a year prior. And the Mac hit sales of 4.9 million, off 14 percent from the same period in 2015.

"Our strong September quarter results cap a very successful fiscal 2016 for Apple," Apple Chief Executive Tim Cook said. "We're thrilled with the customer response to iPhone 7, iPhone 7 Plus and Apple Watch Series 2, as well as the incredible momentum of our Services business, where revenue grew 24 percent to set another all-time record."

Looking ahead to the first quarter of fiscal 2017, Apple is guiding the following:

  • revenue between $76 billion and $78 billion
  • gross margin between 38 percent and 38.5 percent
  • operating expenses between $6.9 billion and $7 billion
  • other income/(expense) of $400 million
  • tax rate of 26 percent