Huawei, which was put on a trade blacklist by the United States since mid-May and was virtually barred from doing business there even earlier, shipped 37.3 million smartphones in China in the three months ended June, up 31% year-on-year, according to market research firm Canalys.
Its market share rose more than 10 percentage points to 38% in the quarter, even as all other top vendors lost ground in the world's biggest smartphone market, the Canalys data showed.
Huawei was added by Washington to a so-called Entity List in May. The blacklisting has threatened to cut its access to essential U.S. components and software such as the Google Android apps.
The addition to the list "caused uncertainty overseas" but the firm has been shifting its focus towards its home market, where it invested in an aggressive offline expansion to lure consumers with a patriotic sales pitch, said Canalys analyst Mo Jia.
Calls to support Huawei have consistently surfaced on Chinese social media on comment threads trailing news on the company.
Kitty Fok, who tracks China's smartphone sector at research firm IDC, said that consumers responded to the spat over Huawei with pro-China sentiment, which helped boost the brand's already-strong appeal in the country.
"The product itself is already well-recognised, and the trade war helped people feel like they need to support Huawei. The only worry was that they might not get the component supply, but in the end, they did," said Fok.
Huawei's second-quarter smartphone shipments surged even as overall Chinese smartphone shipments shrank. Smartphone shipments in China declined by 6% in the quarter to 97.6 million units, the 9th consecutive quarterly fall, according to Canalys.
Oppo, Vivo, Xiaomi Corp and Apple Inc, the top four vendors behind Huawei, saw declines in shipments and market share in the quarter, Canalys said.
The second-quarter China shipments represented 64% of Huawei's total smartphone shipments in the quarter, it said.
"Clearly the international market is a risky one now, whereas in China, where the Android ecosystem is most mature, in terms of sales channels and software income, Huawei has clear advantage in price negotiation," said Canalys analyst Jia.