Hong Kong (CNN Business) Huawei may be under fire globally from a US-led campaign against the company, but in China its smartphones are red hot and outselling the iPhone four times over.

Huawei dominated the Chinese smartphone market in the first three months of 2019, taking a record 34% share as rivals Oppo, Vivo, Xiaomi andall struggled, according to a new report from market research firm Canalys.

It was the only major smartphone maker that managed to grow in China's declining market , and it did so by a huge amount.

The Shenzhen-based company shipped nearly 30 million phones in the three months ended in March, up 41% compared to the same period a year earlier. Apple sales in the first quarter plunged by 30% to 6.5 million phones — its worst decline in two years, according to Canalys.

Apple's iPhone business is struggling worldwide. The California company reported Tuesday that global sales for the first quarter fell 17% from the previous year.

Canalys said that represents the "largest single-quarter decline in the history of the iPhone."

In China, Huawei "is the strongest it's ever been," Canalys analyst Mo Jia said in the report. The company has opened more brick-and-mortar locations, pushed into rural areas and filled its stores with more smart devices and accessories to attract shoppers.

The investments have helped Huawei "gain customers from other vendors, such as Oppo and Vivo, which used to enjoy absolute dominance in offline channels," said Jia.

Unlike Apple, Huawei and other Chinese smartphone makers also have a wide range of low to high-end models, so they can appeal to more cost-conscious buyers.

Huawei's stellar first quarter growth came despite China's smartphone market suffering its worst contraction in six years, with overall shipments declining 3% to 88 million phones.

Globally, Huawei is in pole position to overtake Samsung as the world's largest smartphone maker.

Market research firm IDC said Tuesday that Huawei's smartphone sales worldwide grew more than 50% in the first quarter to 59 million devices. Samsung shipped more than 70 million smartphones during the same period, but that number represented a decline of 8%.

"Huawei is now within striking distance of Samsung at the top of the global market," IDC said in a report.