Image copyright Getty Images

Technology giant Apple said newer lines of business such as Apple Pay, the App Store and Apple Music helped to drive growth in its third quarter.

The services unit was what one analyst described as a "shining light", while sales were robust for Apple's hardware, including iPhones and iPads.

Quarterly profit rose 12% to $8.7bn (£6.6bn). Revenues grew by 7% year-on-year to $45.4bn.

The news sent its stock surging more than 5% in after-hours trade.

Apple, which also forecast strong sales, is expected to release new and updated iPhones next month.

Apple chief executive Tim Cook was tight-lipped when it came to details on the new launch and said reports about the new phones may have caused some people to "pause" their purchases of the existing phones.

But "while that affects us in the short-term, it probably bodes well", he added.

Even with some people waiting for the new models, Apple said the number of iPhones sold in the quarter increased a solid 2% year-on-year, driven by strong demand in markets such as Latin America and the Middle East.

The growth lifted revenue from iPhones, which account for the bulk of the company's sales, by 3% to $24.8bn.

Apple also said the number of iPads sold climbed 15% year-on-year, while revenues from the product increased 2%. The rise follows the introduction of new models, as well as increased efforts to incorporate the tablets into operations at schools and in businesses.

Revenue from other devices, such as the Apple Watch, Apple TV and Beats products, jumped 23% year-on-year.

The one blemish on its results is China, where the company's revenues slipped 9.5% from a year earlier to slightly more than $8bn (£6.1bn).

Apple's flagship iPhone is losing market share to a slew of local competitors, while the company also faces challenges in dealing with China's strict internet censorship regime.

Image copyright Getty Images

Mr Cook stressed the success of its services unit, which includes Apple Pay, the App Store and Apple Music. The division had sales of nearly $7.3bn during the three months to the end of June, a rise of 22% on the same period last year.

Apple Pay now accounts for almost 90% of mobile payment transactions around the world, said chief financial officer Luca Maestri. Paying accounts on the App Store are also on the rise, he said.

Geoff Blaber of CCS Insight described the services business as "the shining light".

"Not only is $7.3bn in revenue hugely significant in its own right, it underlines the ecosystem advantage it has over its competitors outside of China," he said.

Mr Cook also addressed the firm's decision to remove some products from its App Store in China, saying Apple had to abide by the law.

"We would obviously rather not remove the apps," he said. "We're hopeful that over time the restrictions we're seeing are loosened."

Analysis: Dave Lee, BBC North America technology reporter, San Francisco

One of the big worries for investors - and Apple fans, you'd imagine - is that concern that the next iPhone, due in September, could be delayed due to production issues.

But judging by Apple's revenue forecasts for the rest of the year, it seems this will not be the case. It means we can expect anticipation for a big upgrade to the iPhone to step into overdrive, what with it being the device's 10th anniversary year.

In those 10 years, 1.2 billion iPhones have been sold, Mr Cook told investors today.

Apple relies on it heavily for its revenue, which some see as being a weakness in the company - but this quarter has also provided good news for investors when it comes to generating big profits in other areas.

For example, sales of the iPad range - which has been refreshed with a new Pro model - and better software - have grown for the first time in more than three years. The tablet, thought by many to be facing extinction, is stronger than ever: eight of the 10 best selling tablets in the world are made by Apple.

And Apple's services department - the App Store and Apple Music, mostly - had revenues of more than $7.2bn in this last quarter. That makes it, as Apple was delighted to point out today, the size of a Fortune 100 company in its own right.

The big blip, and it's been a blip for a while, was Apple's performance in China.

Mr Cook said the company's performance was in "a trough" and that they were headed to better performance in the region. He tried to put a positive spin by pointing out that the Mac, iPad and services had grown in the country - but acknowledged that performance in Hong Kong was dragging down its numbers.