Apple has just reported its highest-ever third-quarter revenue—$53.3 billion—and a 32% jump in profit from year ago. The iPhone maker is getting close to becoming America’s first trillion-dollar public company.

Less noticed, it was also just overtaken in worldwide smartphone sales by a Chinese rival with a huge disadvantage.

Huawei, based in Shenzhen, is virtually locked out of the US, due to official concerns that its technology could be used by the Chinese government to gather intelligence. The company denies that its products, which include telecom equipment, pose a security risk.

Despite that limitation, Huawei just became the world’s No. 2 seller of smartphones, still lagging Samsung but overtaking Apple for the first time. In the second quarter, Huawei sold 54.2 million units, while Apple sold 41.3 million, according to preliminary data from IDC’s “Worldwide Quarterly Mobile Phone Tracker“ released yesterday (July 31).

Huawei makes high-end smartphones, with its top models rivaling those from Apple and Samsung in quality. While the brand remains unfamiliar in the US, that’s increasingly not the case around the world.

“The continued growth of Huawei is impressive, to say the least, as is its ability to move into markets where, until recently, the brand was largely unknown,” Ryan Reith, an IDC vice president, said in an accompanying statement. ”For most markets, the ultra-high end ($700+) competition is largely some combination of Apple, Samsung, and Huawei, depending on the geography, and this is unlikely to change much in the short term.”

In its home market, Huawei is the leading smartphone maker. For the second quarter, it reached a record-high market share of 27% in China, according to IDC, thanks in part to strong demand for its P20 and P20 Pro models, which sell for $600 to $800 and were released in March.

Samsung Electronics, meanwhile, yesterday reported lackluster smartphone sales for the second quarter, thanks largely to low demand for its Galaxy S9, also released in March. While the South Korean company still enjoys a comfortable lead in global smartphone sales, at 71.5 million for the quarter according to IDC, it faces increasingly tough competition from Chinese rivals including Huawei.

Many product reviewers, for example, rate the P20 Pro higher than the Galaxy S9. Among other advantages, the P20 Pro has three cameras, which in conjunction with the embedded artificial intelligence allows for some nifty tricks, such as low-lighting shots without blurring.

As for Apple, it’s sitting pretty for now. It’s even grown in Huawei’s home market, with China revenue up nearly 20% in the latest quarter. Apple ranks fifth in smartphone market share in China, behind No. 1 Huawei and three other Chinese competitors (Oppo, Vivo, and Xiaomi), according to market research firm Canalys.

Of course, Apple relies heavily on sales in the Americas. Should Huawei ever gain wide access to the US market, it will have more to worry about.