Image copyright Getty Images Image caption The iPhone 7 went on sale in September last year

Apple has reported its first rise in sales in nine months after strong Christmas sales of the iPhone 7.

The tech giant reported net sales of $78.4bn (£62.3bn) for the last three months of 2016, up 3% on last year, and marking its strongest quarter ever.

However, the firm warned some customers were holding back on phone upgrades in anticipation of the 10th anniversary iPhone later this year, suggesting the strong performance may not continue.

The release is expected in September.

Prior to this quarter, the firm had suffered three quarters in a row of falling revenue as mounting competition, particularly from Chinese rivals, hit sales of its flagship iPhone.

The slowdown in iPhone sales - which account for two thirds of income - led to Apple reporting a drop in annual revenue in October, the first such fall in 15 years.

Investors appeared to be relieved by the apparent turnaround, with the firm's shares rising 3% in after-hours trading.

Chief executive Tim Cook said Apple had sold "more iPhones than ever before", with the quarter also setting new records for revenues from its Mac, Apple Watch and services divisions, he said.

iPhone recovery

"We're thrilled to report that our holiday quarter results generated Apple's highest quarterly revenue ever, and broke multiple records along the way," Mr Cook said.

Image copyright Getty Images

Analysis - Dave Lee, BBC North America technology reporter

A momentary sigh of relief for Tim Cook as the iPhone performs very well indeed over the holidays.

But it's worth looking to the future a little, because that's what investors do in these situations.

In its forecasts, Apple said it anticipated people holding off from upgrading until the new iPhone is revealed, meaning a slump in growth, or maybe a return to decline, over the next few months.

While people waiting for the new phone is nothing out of the ordinary, you get the sense Apple fans, both casual and dedicated, are gearing up for something extraordinary.

And that's because this will be the 10th anniversary iPhone - and some are hoping for a major new innovation, rather than the slightly more incremental improvements made in the past couple of years.

As ever, Apple is a victim of its own success. Pressure weighs heavy ahead of the launch which will likely be in September.

Mr Cook said demand was particularly high for the larger iPhone 7 Plus during the quarter.

The iPhone 7 models - which were released in September and included an improved camera but ditched the traditional headphone socket - now account for about 17% of Apple's phone sales, according to research firm Localytics.

Apple said it had sold 78.3m iPhones in the three months to 31 December, up from 74.8m a year before.

It reported revenue of $54.3bn from iPhone sales, along with $7.2bn from the Mac, $5.5bn from the iPad and $4.0bn from other products, including the Apple Watch.

Services boom

Revenues from its services division - including the App Store, Apple Music and iCloud - were $7.1bn. The segment is now close to overtaking the Mac as Apple's second biggest source of revenue.

"Services obviously continues to be a real success story for them," said Jackdaw Research analyst Jan Dawson. "It's one of the fastest-growing segments they have, driven largely by the App Store."

Analysts expect growth in services to help offset declining hardware sales as the smartphone market matures.