A seven-year-old Chinese manufacturer is taking over the world’s second-largest smartphone market.

In the last year, Xiaomi’s market share in India has gone from just 6% to 22%, according to Hong Kong-headquartered market intelligence firm Counterpoint Research. That puts its share at par with South Korea’s Samsung, a leader for several years now. And as of September, three of the five most popular smartphones in India are from Xiaomi, Counterpoint said in a report on October 27.

It’s quite a coup considering Xiaomi entered India only in 2014 – Samsung has been around since 1995. The Beijing-based company has invested around $500 million in the Indian subcontinent in the last two years according to Bloomberg and intends to invest a similar amount between the next three and five years.

Data: Counterpoint Research

This stupendous success, analysts reason, is because of a strong supply chain and the company’s ability to sell value for money products in a very price sensitive market. Xiaomi didn’t respond to an emailed questionnaire from Quartz.

Modus operandi

Since its entry into India, Xiaomi has stood out for its unique go-to-market strategy of selling only via e-commerce. It signed an exclusive partnership with e-tailer Flipkart and ran flash sales for new model launches, with the sales typically ending within seconds of opening. For instance, in a flash sale for the Redmi 1S model in September 2014, around 40,000 pieces were sold out in just 4.2 seconds.

This allowed the company to single-mindedly build capabilities around online retail, which now accounts for around 30% of India’s total smartphone sales. Most other brands have struggled with juggling online and offline sales, with many often failing to satisfy either set of customers.

“They’ve [Xiaomi] managed to streamline their supply chain and make sure the demand versus supply gap is not that significant,” Tarun Pathak, associate director at Counterpoint Research, told Quartz.

While around half the phones sold online are Xiaomi phones now, according to Counterpoint Research, the company has, over the past few months, begun pushing sales through brick-and-mortar stores, too. As a result, Xiaomi’s share of total sales in India from offline channels has doubled to 20% in the last year. It has also worked on creating a cult following in India, a move that analysts say helped create strong branding at a time when they weren’t even investing much in conventional advertising.

To increase its offline sales, Xiaomi is opening direct stores called Mi Home, and partnering with big retail chains like Croma, Univercell, Poorvika, and Sangeetha. In smaller cities, the company has launched a “Preferred Partner Programme” where it ties up with multi-brand outlets to put up Xiaomi signage and promote sales of its models. These preferred partners aren’t exclusive.

“They understood that they can’t be available at every nook and corner. So, these partners helped them maintain a buzz and pull in the market,” Jaipal Singh, senior analyst at market research firm IDC India, told Quartz.

Manufacturing push

Unlike other players that import devices, Xiaomi has set up two manufacturing facilities in Andhra Pradesh where it manufactures over 75% of the handsets it sells in India. These units are run in partnership with Taiwanese electronics manufacturer Foxconn.

“Xiaomi made the right moves when it comes to supply-chain and localisation,” Pathak of Counterpoint said. “It is not easy to forecast demand and then push out products.” The company is now considering setting up a third unit to meet growing demand.

It also seems to have played the pricing game just right. Xiaomi’s success so far has come almost entirely from the mid-price smartphone segment (between Rs 10,000 and Rs 20,000), among the fastest-growing in India. All its models in the country fall in that range, or are cheaper, and Xiaomi phones have more features than its rivals’ products.

As a result, three of the five highest selling smartphones in India between July and September were made by Xiaomi, according to Counterpoint Research. The top five smartphone models in India in Q3 2017 were Xiaomi Redmi Note 42, Xiaomi Redmi 43, Xiaomi Redmi 4A4, Samsung Galaxy J25 and Oppo A37.

Maintaining the lead

However, it’s not going to be easy for Xiaomi to hold on to its market share.

For one, its South Korean rival is likely to come out all guns blazing. “Samsung will become aggressive going forward now,” Singh of IDC said. After all, India is a key market for Samsung, which has remained a market leader for years now, while Apple is still making inroads. Between July and September 2017, Samsung maintained its 23% market share in India, but missed capturing the Rs10,000-15,000 segment where Xiaomi managed to cater to most of the demand.

There are others, too, including China’s Oppo, Vivo, and Huawei, and Indian firms Micromax, Lava, and Karbonn Mobiles. In all, Indians today have over 150 models of phones to choose from.

So far, Xiaomi has managed to crack the code, but holding on to its spot at the top of the Indian smartphone market will be a different challenge.

This article first appeared on Quartz.