The April-June results released on Thursday came against a backdrop of adversity that has been raising worries about the trajectory of a longtime tech kingpin that expects to absorb a setback of nearly two billion dollars (£1.5 billion) from the tariffs that President Donald Trump has already imposed and others in the pipeline.

Despite the doubts, Apple remains a moneymaking machine.

The company earned 23.4 billion dollars (£17.8 billion) during its fiscal third quarter, a 9% increase from the same time last year.

Revenue climbed 10% from a year ago to 94 billion dollars (£71 billion). The company’s iPhone sales surged 13% from a year ago to 44.6 billion dollars (£33.8 billion).

In another positive development, Apple’s business in China showed signs of snapping out of a prolonged malaise with a 4% bump in revenue from the same time last year.

Apple chief Tim Cook (PA)Apple chief Tim Cook (PA)

All those numbers were well above the analyst projections that steer investors, helping to boost Apple’s recently slumping stock price by about 3% in extended trading.

But the unexpectedly solid performance does not necessarily mean it is smooth sailing ahead for Apple.

Mr Trump’s trade war targeting foreign-made products such as the iPhone and Apple’s stumbling start in the pivotal transition to AI is causing investors to question if the company will remain at the tech forefront as the industry moves into a new era.

Before Thursday’s report came out, Apple’s stock price had plunged by 17% so far this year to wipe out more than 600 billion dollars (£455 billion) in shareholder wealth and knock the company off its perch as the world’s most valuable company.

Meanwhile, the shares of AI chipmaker Nvidia have surged 32% this year and the shares of AI pacesetter Microsoft have gained 27%, propelling the market value to four trillion dollars (£3 trillion).

Even though Apple remains highly profitable, the tariffs that Mr Trump has already imposed on China and other countries cost the company 800 million dollars (£600 million) during the past quarter, and CEO Tim Cook told analysts during a conference call that the fees would exact an additional toll of 1.1 billion dollars (£830 million) during the July-September period.

iPhone 16eiPhone 16e (Apple/PA)

The company also predicted its revenue for July-September period would increase at a slightly slower pace than the past quarter.

Mr Cook indicated the financial damage from the tariffs could have been much higher, telling analysts most of the components in iPhones and other Apple products are still shielded by temporary exemptions that the Trump administration granted most electronics in mid-April.

Apple softened the blow of Mr Trump’s tariffs on products made outside the US during the past quarter by shifting its production of iPhones from China to India.

But the administration intends to impose a 25% tariff on goods from India, a move that could intensify the pressure on Apple to raise the prices on the next generation of iPhones expected to be released in September.

Mr Cook was not asked about the possibility of an iPhone increase during his Thursday remarks to analysts.

Consumer fears about the tariffs driving up iPhone prices spurred an unusual buying spree of iPhones and Mac computers in the US during early April, according to Mr Cook.

Apple estimated that spike accounted for roughly one percentage point of its 10% revenue increase in the past quarter, which translates into about 82 million dollars (£62 million) in sales.

Mr Cook also credited an uptick in consumers upgrading to the latest model for helping Apple sell its three billionth iPhone since the device’s 2007 debut.

Mr Trump has been pressuring Apple to make all its iPhones in the US, a move that analysts believe would take years to pull off and ultimately double or triple the average price of the device.

But Mr Cook told analysts Thursday that the company is pushing to increase its computer chip production in the US as one way of avoiding tariffs.

“We ultimately will do more in the United States,” he said.

Meanwhile, Apple is still trying to fulfil the AI promises it made last year when it unveiled an array of new iPhone features built on the revolutionary technology, raising expectations that the shift would spur millions of people to upgrade their old devices.

But Apple still has not delivered on an AI upgrade that was supposed to smarten up its often-bumbling virtual assistant Siri, one of the main reasons underlying the lacklustre growth of iPhone sales.

“While these numbers certainly buy Apple time, the fact is that investors — and consumers — remain laser-focused on AI innovation. And Apple still has a long way to go in this game,” said Investing.com analyst Thomas Monteiro.