Record iPhone sales have driven Apple back to growth, with the US giant reporting an increase in revenue for the quarter ending 31 December 2016.

Apple posted revenue of $78.4bn for the quarter compared to $75.9bn in the same period last year.

The Cupertino-based company sold 78.2 million units of iPhones in the first three months of its fiscal 2017, up 5% compared to the corresponding period in 2016.

iPhone sales surged 72% in the quarter on a sequential basis, after seeing a decline for three consecutive quarters.

Apple’s CEO Tim Cook said: “We sold more iPhones than ever before and set all-time revenue records for iPhone, Services, Mac and Apple Watch.

The iPhone being the main driver of Apple’s turnabout has been attributed to the US giant taking advantage of Samsung customers who were impacted in the heavily publicised Galaxy Note recall.

Richard Windsor, analyst at Edison Investment Research, said that the firm’s return to growth was “primarily driven by Apple taking a good share of users that purchased the Note 7 and were left high and dry by the recall.”

“Users appear to have taken this opportunity to move from Android to iOS, a move applewhich is pretty much a one-way street. We find this surprising as the iPhone 6 is now in its third generation meaning that a large screen iOS device has been an option for users for 2.5 years. This means that most high-end Android users have already purchased a new Android device despite a large screen iOS option being available.

“This is what led us to believe that iOS would not benefit from Samsung’s Note 7 disaster but this logic appears not have been correct. Instead it appears that the negative stigma surrounding the recall has been enough to encourage users to switch away from Android despite the fact that many apps will need to be repurchased,” said the analyst.

The analyst firm estimates that around 2.5 million customers were affected by the Samsung recall, of which 2 million bought an iOS device.

The smartphone maker forecasts its revenue to be between $51.5bn and $53.5bn in the January-March quarter.

Apple CFO Luca Maestri said: “We returned nearly $15bn to investors through share repurchases and dividends during the quarter, bringing cumulative payments through our capital return program to over $200bn.”