Just in case you assumed Apple would eventually get a lock-down on the high-spec smartphone market in China, don’t forget Xiaomi. According to reports, the homegrown company has just closed a round of financing that values it at $4 billion, with Yuri Milner’s Digital Sky Technologies rumored to be among the investors.

Yep, that’s $4 billion: about half the total of Nokia’s market capitalization, and creeping up on RIM’s $5.4 billion valuation. To get to that point, it took Xiaomi all of two years.

Established in April, 2010, Xiaomi launched its first high-capability Android phone, the $315 Mi-One, in August last year and sold 300,000 pieces within 34 hours of opening its online ordering system. A few days ago, chairman and CEO Lei Jun told China Daily that he expects to sell more than 5 million Xiaomi handsets by the end of 2012, with annual revenue surpassing $1.57 billion. According to ZDNet Asia, the startup has reported a net profit of $393 million, which is impressive to say the least for a company that has seemingly come out of nowhere.

Xiaomi takes only very small margins on its hardware, instead making money on software and other services, which allows it to undercut the iPhone 4 by as much as $470 per device. The company does most of its marketing online and by word-of-mouth, and founder Lei claims it takes a third of its design ideas from users, which helps explain why it has such an ardent fan base. The phones are also sold solely online.

Lei, who is 43, is a spirited character in China’s tech world. A serial entrepreneur, he first made a name for himself by becoming the CEO of Kingsoft, a leading Chinese software developer, at just 25. In 2004, he sold ecommorce company Joyo.com to Amazon for $75 million. Three years later, Kingsoft went public and Lei retired. He became an angel investor in many Chinese Internet companies, including UCWeb, the country’s dominant mobile browser, before deciding to pounce on what he saw as the next big trend: mobile Internet.

Xiaomi is competing in an increasingly crowded field, with Internet giants Baidu, Tencent, Alibaba, and Shanda all introducing their own competitively priced smartphones into the market. But, like Apple, it has an advantage because it has integrated hardware, software, and services into its business from its very inception.

“It’s trying to recreate the Apple exprience at the low end for Android users,” says Kai Lukoff, the Beijing-based co-founder of China tech blog TechRice, who is now product manager for Wandoujia, an Android app search engine. “It’s all about the integration of the software and the hardware. If you just had one or the other, it’s insufficient.”

Whether or not that’s worth $4 billion is another matter, but it should be enough to make Apple think twice about its strategy for the huge part of China’s market that wants a high-spec smartphone but can’t afford the premium price.