Xiaomi has arrived.

The upstart Chinese smartphone maker has knocked Samsung off its throne in China, shipping more units than its South Korea-based rival for the first time in the second quarter.

The performance is the latest indication that Xiaomi has evolved from niche player in China to a major force in its home market.

The company, founded just four years ago by Lei Jun, captured 14% of the Chinese market in the second quarter, according to research firm Canalys. That translates to 15 million smartphones, a 240% improvement over the same period last year.

"This is a phenomenal achievement for Xiaomi," said Canalys analyst Jingwen Wang, who praised Xiaomi's marketing and product lineup.

Related: China's red hot phone market is cooling

In a nod to the competitiveness of the smartphone business in China, Xiaomi has only a narrow lead over its rivals. Samsung, Lenovo, Yulong and Huawei all have more than 10% of the market. Samsung, in particular, is expected to rebound in the third quarter.

"[Xiaomi] does now need to deliver LTE products in China to address growing demand for 4G services if it is to retain its momentum," Wang said.

Xiaomi is still relatively unknown outside China, the destination for 97% of its shipments in the second quarter. But the company has been quietly stockpiling tech talent as it builds a business worth more than $10 billion.

Last year, the firm poached Google (GOOG) executive Hugo Barra to help fulfill its ambition to become a global player. Indonesia, Mexico, Russia, Thailand and Turkey have all been mentioned as expansion targets.

Related: China's Xiaomi poaches top Google exec

The privately-held company is known in China for its rabid fanbase and skillful marketing. Its phones -- which some critics deride as Apple knockoffs -- typically price at around $130, or just about the cost of parts and labor.

"Our business model is more similar to Amazon," Lei told CNN last year, referring to Amazon's (AMZN) habit of selling hardware at cost.

"We sell all our products online and our gross profit rate is very low. Our price is one third of Apple's," he said. "We make our profits through content and services."

Xiaomi engineers are also encouraged to speak directly to consumers, gathering feedback they use to tinker with the company's software.

The turnaround is rapid, and Xiaomi updates its Android operating system every Friday, much to the delight of its obsessed fans.