Apple said on Tuesday that its services business in the fiscal third quarter grew about 13%, reflecting the company's effort to expand in subscription products as the iPhone sales slow.

Revenue in services, which includes the App Stores Apple Care, Apple Pay, iCloud and Apple Music, increased to $11.46 billion from $10.17 billion a year earlier, and came in below the $11.68 billion consensus estimate among analysts polled by FactSet. Services represent more than one-fifth of Apple's overall revenue.

For years Apple has told investors how much revenue it gets from services, but it only started disclosing costs related to the business in January, at the same time that it stopped breaking out unit sales for hardware like the iPhone and iPad. In the quarter that ended on June 30, Apple reported a 64.1% gross margin in services, roughly in line with the 64% margin in the prior period and up from 63% in the first quarter. Cost of sales came out to $4.11 billion in the quarter, according to a statement.

Profit from non-hardware products is becoming increasingly important as the iPhone hits market saturation. Services, which often involve recurring payments, remain a smaller revenue contributor than the iPhone, but they're becoming more meaningful over time.

"Maintaining or growing Services gross margin is likely to be critical to earnings expectations and investor confidence," KeyBanc Capital Markets analysts led by Andy Hargreaves wrote in a note to clients on July 22. The analysts, who have the equivalent of a hold rating on Apple, predicted a 62.9% Services quarterly gross margin.

More Apple services are coming, including Apple Arcade for gaming and Apple TV+ for exclusive video content. Such additions could boost revenue, but growth becomes harder as the numbers get bigger.

"While there is potential for new services in video, news, gaming, and financials to drive better-than-expected revenue, these services enter more competitive fields where Apple has had little success to date," the KeyBanc analysts said.

Follow @CNBCtech on Twitter for the latest tech industry news.