Richard Yu, CEO of Huawei's consumer business, speaks as he presents the P30 series smartphone during a launch event in Paris.

Apple and Samsung reported slowing smartphone sales in the first quarter of this year, but Chinese tech giant Huawei is bucking the trend in a big way.

Huawei's smartphone shipments surged 50% in the first quarter compared to the same period last year, while Apple iPhone shipments tumbled 30%, according to new data published Tuesday by research firm IDC. Samsung shipments dropped 8% year-on-year.

The new figures show Huawei capturing a 19% share of the global smartphone market, its highest percentage ever. IDC said the Chinese firm is "now within striking distance" of Samsung at the top of the global market, surging past Apple as the world's second-largest smartphone seller.

"This new ranking of Samsung, Huawei, and Apple is very likely what we'll see when 2019 is all said and done," IDC Program Vice President Ryan Reith said in the report.

Huawei first surpassed Apple in market share in 2018, but the first quarter's figures show a much wider spread between the two tech giants than previously reported. IDC attributed Huawei's growth to a "well-rounded portfolio targeting all segments from low to high."

Apple's iPhone sales have been hit by weak demand in China and longer replacement cycles. Apple CEO Tim Cook was upbeat in his assessment of the Chinese market on Tuesday, but the company still reported a 22% drop in revenues in the region for its March quarter.

Separate data published Tuesday by research firm Canalys showed Huawei capturing 34% of the Chinese smartphone market, an increase in shipments of 41% from the year before. The firm said Huawei has gained ground among Chinese consumers by increasing its investments in brick-and-mortar stores and penetrating further into China's rural areas.