Apple’s most popular product, the iPhone, has been witnessing a decline in sales for the past three consecutive quarters. Despite this, the company is doing well in the smartphone market, according to the latest data from research firm Strategy Analytics.

iPhone 7 Plus Apple

Apple way ahead of rivals

According to Strategy Analytics, in the third quarter, Apple’s profit share in the worldwide smartphone market was a record 91% or $8.5 billion of the overall $9 billion. Apple’s performance is surely impressive, as no other smartphone maker could generate profits of more than $200 million in the quarter, said Strategy Analytics.

Samsung, Apple’s biggest rival, could not even find a place anywhere on the list. Chinese manufacturer Huawei acquired the second spot, while Vivo was third and OPPO took the fourth spot, claiming profit shares between 2.2% and 2.4% each. Apple’s profit was 40 times larger than its closest competitor.

Neil Mawston, executive director at Strategy Analytics, said, “Huawei captured 2 percent share of all smartphone profits, taking second spot overall, and becoming the world’s most profitable Android vendor for the first time ever.”

Previously, BMO Capital Markets analyst Tim Long estimated that Apple captured 103.6% of smartphone industry profits in the third quarter, the reason being that companies such as LG and HTC reported losses for their smartphone divisions. The reason for the discrepancy between the two datasets (Strategy Analytics and Long) is unclear.

Maximizing pricing and minimizing production cost

Linda Sui, director at Strategy Analytics, credits Apple’s skills in managing the relationship between pricing and production cost for continually strong profit maximization.

“Apple’s ability to maximize pricing and minimize production cost is hugely impressive and the iPhone continues to generate monster profits. Huawei, Vivo and OPPO are the next three most profitable smartphone vendors globally this quarter, but they are still a long way behind Apple,” said Sui.

On a year-over-year basis, a decline in iPhone sales was seen in the second, third and fourth quarters of fiscal 2016. Only a marginal rise was seen in the first quarter, making Apple’s record-breaking profits even more impressive, notes MacRumors.

For its most recently completed quarter, Apple officially reported revenue of $46.9 billion on sales of 45.5 million iPhones. It also reported an operating profit of $9 billion. The company performed poorly in China, as a result of which its growth numbers went down significantly, but that was offset to a certain extent by the growth it made in 33 countries.

On Tuesday, Apple shares closed up 0.06% at $111.80. Year to date, the stock is up more than 6%, while in the last six months, it is up more than 17%.