Long considered around the world to be a brand that makes a range of affordable phones, Xiaomi is shedding that image to enter the high-end smartphone market. The company aims to surpass Apple to become the top seller of premium smartphones in China in three years, the company’s CEO Lei Jun said on Tuesday.

To achieve that goal, Xiaomi will invest RMB 100 billion (USD 15.7 billion) in R&D over the next five years. It will benchmark its products and user experience against Apple’s product lines, according to a Weibo post by Lei. Xiaomi has already formed a team to formulate its strategy for designing, producing, and selling premium handsets and lead the transformation.

Lei said this is the only way for his company to achieve high-end status. “This will be a life-or-death battle for our development,” he wrote on Weibo.

With a set of loyal customers who purchase the company’s IoT products—air conditioners, humidifiers, space heaters, lamps, and much more—for their homes, Xiaomi has developed a much wider range of consumer products than Apple. But that hasn’t distracted the company from its path to become the top-selling smartphone brand globally in June 2021.

However, a global shortage of semiconductors limited Xiaomi’s shipments in the second half of 2021, and Xiaomi lost its lead to Apple and Samsung.

Now, as the company attempts to retake lost market share and, in particular, become the top brand in its home market, Xiaomi faces stiff competition from the likes of Oppo, Vivo, and Honor, the latter of which was spun off from Huawei in 2020.

Xiaomi’s market share in China contracted from 17% in Q2 to 14% in Q3 2021, with Honor eating into most of that lost business, according to Counterpoint Research. It continued to slide to 13.2% in Q4 last year while Apple’s sales in China surged, according to IDC.

Xiaomi defines its premium phones as those priced at or above RMB 3,000 (USD 470). In all, the company has eight models in this category. In late 2021, it launched the Xiaomi 12 series, which is priced at RMB 3,199–4,699 (USD 500–740). In comparison, Apple’s latest handset, the iPhone 13, costs upwards of USD 699.

Outside of China, Xiaomi’s phones are mainly sold in Latin America, Western Europe, and the Middle East. In Q3 2021, the company shipped 18 million premium phones worldwide, a 180% year-on-year increase.

In the past, Xiaomi has been compared unfavorably with Apple, with critics going so far as to say Lei’s wardrobe mimicked Steve Jobs’ trademark black turtlenecks and blue jeans. In fact, prior to establishing Xiaomi, Lei was inspired by the book Fire in the Valley: The Making of the Personal Computer, which unpacks the origins of the PC and devotes a portion of its narrative to the story of Apple since its founding.

Lei’s phone and consumer electronics company has been transitioning its business direction over the past two years, he said on Weibo. At the moment, the founder wears multiple hats, even within Xiaomi. Aside from his foray into the high-end smartphone market, Lei is also leading the company’s electric vehicle division, which is being built out using USD 10 billion in capital invested over ten years beginning in 2021.

Brady Ng contributed to this report.