(Reuters) - Apple Inc AAPL.O iPhone sales dropped to less than half of quarterly revenue for the first time in seven years, but CEO Tim Cook on Tuesday described the change as successfully diversifying away from a single product and forecast results above Wall Street targets.

That strategy proved especially useful in China, the world’s largest smartphone market. Investors feared a drumbeat of negative shipment data from the Chinese government and analysts meant problems for the iPhone maker.

Apple’s greater China sales, which had gone into a near free fall earlier this year, dipped only slightly, assuaging concerns that trade tension were undermining Apple’s standing in one of its most important markets. Shares rose 4.25% after hours.

Moribund global mobile phone sales have led Apple to focus on accessories like the Apple Watch and growth in music, apps, gaming, video and a credit card coming in August. In mainland China, Cook said the overall number of Apple device users had grown in the fiscal third quarter, helping to increase the market for its services, whose sales were up by more than 10% there.

“We actually grew in mainland China,” Cook told Reuters. “Non-iPhone revenue grew 17%. We grew in every category outside of iPhone.”

But globally, iPhone sales fell 12% to $25.99 billion, after dropping 17% in the previous quarter, and matched Wall Street targets.

Graphic: iPhone fade - tmsnrt.rs/2yAEoCh

Wearables and other accessories revenue rose nearly 50%, topping expectations.

Services revenue rose 12.6% to $11.46 billion, slowing and slightly missing expectations but setting a new record.

Apple said it expects revenue for the current fiscal fourth quarter of between $61 billion and $64 billion, compared with analyst estimates of $61.02 billion. At the high end of Apple’s forecasted range, sales would beat the prior year’s $62.90 billion in sales, despite the fact that analysts expected continued lackluster iPhone sales until 5G models arrive in 2020.

For the fiscal third quarter ended in June, Apple reported a 1% rise in revenue to $53.8 billion and a 7% drop in earnings per share to $2.18, compared with expectations of $53.39 billion and $2.10 per share, according to Refinitiv data.

Hal Eddins, chief economist for Apple shareholder Capital Investment Counsel, said he was pleasantly surprised to see iPhone sales declines slow down versus the prior quarter.

“You really don’t hear people talk about their phones like they did several years ago,” Eddins said. But, “the key is that when people want to splurge on a phone, they do it with an Apple product.”

FILE PHOTO: A customer checks Apple watches at the grand opening of the new Apple Carnegie Library store in Washington, U.S., May 11, 2019. REUTERS/Joshua Roberts/File Photo

Apple did not give the number of active Apple devices, but in January it said it was 1.4 billion, with 900 million of those being iPhones. Investors used the number, called the installed base, as a proxy for how many subscribers it can gain for its services business. Cook told investors on a conference call Tuesday that Apple has 420 million paid subscribers to its own services and third-party apps. The company has set a goal of 500 million by 2020.

Trip Miller, managing partner at Apple shareholder Gullane Capital Partners, said he wants to see services growth return to the 20% range and thinks Apple needs to use its billions in cash to buy media properties to fuel its forthcoming television service.

“You have to have a bigger installed base and have services that people get value from,” Miller said.

TRADE TENSION STILL LOOMS LARGE

Apple reported results as U.S. and Chinese trade negotiators resumed off-and-on talks. U.S. President Donald Trump has suspended new tariffs on a final $300 billion of Chinese imports, which would include iPhones.

Trade tension has slowed down economic growth in China, a major market for Apple, which effectively cut iPhone prices in China earlier this year after currency exchange rates had made its phones too expensive for many Chinese consumers.

Apple’s market share in China declined to 5.8% from 6.4%, according to market research firm Canalys, in part because smartphone rival Huawei Technologies Co Ltd gained market share to become the top handset seller in the country.

But Apple experienced a smaller market share loss than competitors such as Xiaomi Corp 1810.HK, Oppo and Vivo, according to Canalys data. Cook said that iPhone price adjustments, plus the Chinese government's move to cut phone taxes, helped keep iPhone sales in China from eroding further.

“Our trade-in and financing programs are doing extremely well in China,” Cook told Reuters. “Because of the active installed base is growing in China, our services business is doing very well, growing double digits.”

Apple shares have gained more than 20% since early June, when shares dropped on news that the U.S. Department of Justice had jurisdiction over the company in a potential probe as part of a broader review of whether technology giants engage in anticompetitive practices.

Apple said revenue for its “Wearables, home and accessories” segment that contains devices like the Apple Watch and AirPods was $5.53 billion, compared with analyst estimates of $4.81 billion.

Apple said it returned more than $21 billion to shareholders during the fiscal third quarter, including $17 billion in share repurchases. It declared a dividend of 77 cents per share.