Though revenue fell 2.5 per cent to $94.8 billion, according to a statement, that was better than the $92.6 billion analysts predicted. Apple itself had projected a decline of about 5 per cent.
The results suggest that Apple is bouncing back from a slump that has plagued both the computer and smartphone industries.
It is a particular relief for investors after Qualcomm, a key Apple supplier, raised fresh concerns about phone demand earlier this week.
A 1.5 per cent rise in Apple's iPhone revenue contrasted with the broader consumer electronics industry, which is grappling with a decline in sales of smartphones, tablets and PCs as consumers and businesses who scooped up electronics during the pandemic tighten spending amid rising interest rates and economic uncertainty.
Those results occurred against the backdrop of a 13 per cent decline in global smartphone shipments during the first three months of 2023, during which research firm Canalys said Apple gained market share against its Android rivals.
Apple chief executive Tim Cook told Reuters in an interview on Thursday that the company set a fiscal second-quarter record for iPhone sales, thanks in part to picking up new users in markets such as India, where Mr Cook recently travelled for the opening of the company's first retail stores in the country.
“We were thrilled by our performance in emerging markets,” Mr Cook said.
“We set records for the iPhone installed base in every geographic segment, and we had very strong 'new to' [sales in] emerging markets, particularly in Brazil, India and Mexico.”
Mr Cook also said supply-chain snarls have vanished.
“We had no material shortages at all during the quarter across any of the products,” he said.
But not all of Apple's business lines were immune to the electronics slump, with sales of Macs falling 30 per cent while iPad revenue slipped.
Other firms in the industry have predicted a rebound in the second half of the year, and Wall Street expects Apple to recover faster and show modest year-over-year revenue growth during its fiscal third quarter ending in June.
Bloomberg has reported the iPhone maker could unveil a mixed-reality headset as soon as next month, when it holds its annual software developer conference.
Apple's biggest growth segment was its services business, which includes products such as iCloud and Apple Pay, which grew 5.5 per cent to $20.9 billion, in line with analyst expectations.
Mr Cook said Apple now has 975 million subscribers on its platform, which includes both Apple services and third-party apps, up from 935 million last quarter and an increase of 150 million from a year ago.
Apple also announced plans for $90 billion in stock repurchases, the same as last year’s plan.
Apple shares rose 2 per cent in after-hours trading.
Agencies contributed to this report