A girl reacts as she tries an iPhone X at the Apple Omotesando store on November 3, 2017 in Tokyo, Japan.

If you had told any serious Apple observer two years ago that the company's stock would jump after reporting a sales decline for the iPhone, they would've called you nuts.

But that's where we were Wednesday morning after Apple reported in its fiscal third-quarter earnings that iPhone sales fell 12% versus the year-ago quarter. In fact, iPhone sales made up less than half of the company's revenue for the quarter for the first time since 2012. (In the past, iPhone revenue made up as much has two-thirds of Apple's sales.)

That shift proves Apple is kicking its addiction to the iPhone. It's no longer tying its destiny to just one device, but an expanding ecosystem of digital services and hardware accessories that can spur growth and deliver strong results as iPhone sales decline. And in the years to come, there are plenty of opportunities to continue the trend.

Let's take a look at the stats:

Apple booked $25.99 billion in iPhone revenue during its fiscal third quarter. That's down 12% from the year-ago quarter, and 48% of Apple's overall revenue of $53.8 billion. It's also the first time the iPhone made up less than 50% of quarterly sales since 2012.

The wearables business, which includes AirPods, Apple Watch and Beats headphones, brought in $5.53 billion. That's a whopping 48% higher from the year-ago quarter. And the category is now bringing in more revenue than the iPad or Mac businesses. Apple's CFO, Luca Maestri, also said Tuesday that the category's growth is accelerating over 50%.

Apple's new darling, the services business, also showed strong growth. It's up 13% versus the year-ago quarter with $11.46 billion in revenue. (Apple CEO Tim Cook said the growth was as high as 18% if you account for a one-time lawsuit settlement and foreign exchange rates.)

The iPad and Mac businesses are steady. Thanks to a slew of recent upgrades to Macs and iPads, these two businesses were slightly up versus the year-ago quarter. They may not look as exciting as the hyper growth in wearables and services, but they function as an engine of stability for Apple. Plus there are more upgrades expected for Macs and iPads this fall.

Add all of that together, and you have what looks like an increasingly diversified business with more promising growth on the immediate horizon.

That's especially true for the services segment, which is expected to ramp up even more in the second half of this year with the introduction of new products like the Apple Card, Apple Arcade gaming service and Apple TV+ video streaming service. Don't be surprised to see a slew of new services beyond that related to health care, transportation and more.

Still, there are also the obvious caveats. Apple's businesses outside the iPhone remain anchored to the device, which is why the company touts its active iPhone user base instead of the number of units it sells. Each one of those nearly 1 billion users is an opportunity for Apple to grab more sales from services and accessories.

But Apple has showed a willingness to tear down its so-called walled garden and put its digital services on third-party products like Samsung TVs and Amazon's Echo speakers. Cook hinted during Tuesday's earnings call that the trend will continue. And iPhone users remain extremely loyal, even if they're not upgrading as often as they used to. A robust services business only increases the stickiness of the iPhone.

As Tuesday's results showed, the iPhone may be Apple's most important and profitable product, but the company has found a way to diversify and grow without relying solely on it.