Apple sold more iPhones than Wall Street expected in the third quarter and estimated its revenue in the current period would top many analysts' targets, soothing fears that demand for the company's most important product had hit a wall.
Its shares rose 7% in after-hours trading.
The world's most valuable publicly traded company said it sold 40.4m iPhones in the third quarter, down 15% from the year-ago quarter but slightly more than the average analyst forecast of 40.02m.
iPhone sales dropped for the second straight quarter, pushing down Apple's total revenue 14.6% in the fiscal third quarter, ended 25 June.
Demand for Apple's phones has waned in China, partly because of economic uncertainty there, and has also slowed in more mature markets as people tend to hold on to their phones for longer.
The sales slump has stoked concerns about whether the tech leader can continue to deliver profits at the level Wall Street has come to expect.
"China was a major letdown," said Patrick Moorhead, an analyst at Moor Insights & Strategy.
"Samsung and Huawei are much more competitive now than a year ago and the Chinese economy is not doing well at all."
Mr Moorhead said, however, that increased services revenue -which includes the App Store and iCloud - was a "very big bright spot for Apple."
Chief Financial Officer Luca Maestri told Reuters in an interview that Apple's performance had topped his expectations in a quarter weighed down by tough foreign exchange rates and difficult comparisons with blockbuster iPhone 6 sales from the previous year.
Apple reduced channel inventory by $3.6 billion, exceeding the $2 billion expected reduction, meaning sales were better than they appeared, Mr Maestri said.
Customer demand "was better than what is implied in our results and better than we had anticipated," he said.
Sales of the iPhone fell last quarter for the first time since the gadget's release in 2007, dropping 16.3%.
Mr Maestri projected the gadget's average selling price to rise in the September quarter.
The iPhone drives about two-thirds of Apple's total sales.
Apple Chief Executive Tim Cook said during a call with analysts that the iPhone SE, a cheaper, four-inch (10 cm) phone released this year, was extending the range of people able to buy Apple phones.
"It's opening the door to customers we weren't reaching before," he said.
Apple's quarterly net profit fell 27% to $7.8 billion, while revenue of $42.36 billion beat analysts' average estimate of $42.09 billion.