Apple on Thursday reported a return to sales growth in its fiscal third quarter as iPhone revenue topped Wall Street targets, helping cushion a bigger-than-expected sales decline in major market China.

The company said revenue rose 4.9% to $85.78 billion in the three months ended June 29, beating the average analyst estimate of $84.53 billion, according to LSEG data.

Sales of iPhones fell 0.9% to $39.30 billion, a smaller decline than the 2.2% drop analysts expected, as demand picked up ahead of the launch of artificial-intelligence features.

iPhone revenue topped Wall Street targets, helping cushion a bigger-than-expected sales decline in major market China. AP

Chief Financial Officer Luca Maestri told Reuters in an interview that the iPhone results were better than he had expected three months ago. “The iPhone 15 family has been doing well from the very beginning and still now – we have three quarters of the year behind us. It is performing better than the previous cycle, the iPhone 14.”

Apple has taken to discounting its iPhones in China to compete with the much cheaper alternative smartphones offered by local competitors such as Huawei. The company in May offered discounts of up to 2,300 yuan ($317) on selected models.

Still, Apple’s sales in Greater China declined 6.5% to $14.73 billion. Analysts had expected a decline of 2.4%, according to Visible Alpha.

Maestri said that China sales fell less than 3%, excluding the effects of foreign exchange.

Analysts expect a strong upgrade cycle for the iPhone 16 series, likely to be launched in September. The company unveiled a raft of AI products and services it calls Apple Intelligence at its developer conference in June. To operate Apple Intelligence requires at least an iPhone 15 Pro, which may push consumers to upgrade their devices.

Tim Cook’s Apple is likely to launch the iPhone 16 series next month. Getty Images

Apple shares rose 2% after hours.