Apple on Tuesday shook off worries that its $1,000 iPhone had failed to live up to the hype – but sales of the world’s most valuable company’s most valuable product are slowing, and Apple has announced a plan to buy its way out of trouble.

Releasing its latest quarterly report, Apple announced it had sold 52.2m iPhones in the quarter ending 31 March, at an average price of $728.54. Sales were up 3% compared to last year and slightly lower than analysts had expected, but numbers beat the gloomiest forecasts and were enough to deliver Apple its best second quarter ever, with revenues of over $61bn. That beat the record of $58bn set in 2015.

“We’re thrilled to report our best March quarter ever, with strong revenue growth in iPhone, services and wearables,” said Tim Cook, Apple’s chief executive officer. “We are very bullish on Apple’s future,” Cook told analysts after the news broke.

Apple sold 9.11m iPads and 4.08m Macs over the quarter.

Analysts had worried that the high-priced iPhone X would dent sales. The results came after Apple suppliers including AMS and Taiwan Semiconductors have reported slowing revenues in a sign seen by analysts as proof of shaky demand for iPhone X.

The company announced it would be adding $100bn to its stock buyback programme, plus a 16% increase in its quarterly dividend. Taking advantage of the Trump administration’s new tax laws, Apple is in the process of repatriating the majority of the $252bn in profits it currently holds overseas.

The buyback helped Apple’s shares rise over 5% in after-hours trading. The company’s stock has risen by about 80% in the past two years, setting it on course to battle Amazon to become the first company to be valued at $1tn. But Apple’s share price has stumbled recently as fears about slowing iPhone sales took their toll.

The iPhone remains Apple’s biggest product, even as sales of services and other items, including the Apple Watch, have grown. Services – from the Apple Store, iCloud, Apple Pay and others – generated $9bn over the quarter. But the 11-year-old mobile device accounts for the majority Apple’s revenues and contributed $100bn over the quarter. Despite the better-than-expected results, however, sales are slowing.

Thomas Husson, principal analyst at Forrester, said the results did not mean innovation in the high-end smartphone is dead.

Husson said: “However, it indicates Apple will have to smartly manage its iPhone product portfolio and pricing, especially in Asia, where some countries still witness smartphone growth Apple has proven over the past few years that it masters the art and science of managing its product portfolio.”

Yet Husson believes 2018 represents a tipping point for Apple. “It has no choice but to demonstrate it can reduce its dependency on iPhone sales and enter new adjacent markets and territories,” he said. “Because it’s a human-centered and ideas-driven marketing company, Apple is still the most valuable brand worldwide and it would be a mistake to make too early a call based on this quarterly financial earnings.”

On a call with analysts Cook was once again critical of tech rivals, including Facebook, that have been rocked by privacy scandals. “We believe privacy is a fundamental human right,” he said.