Microsoft has sold 1,500 patents to Xiaomi Corp. in a move that will allow China to export a $400 “iPhone Killer” to Western markets — legally.

Breitbart News reported that Apple, Inc. stock is down 24 percent, or $162.2 billion, in value over the last year due to iPhone’s market share plunging since the fourth quarter of 2015.

The Apple iPhone’s market share peaked at 16 percent in late 2015, after a three-year run as the number one brand in China. Since then, the iPhone market share in China has plunged to just 11 percent.

With the actual number of iPhones sales falling by 14.8 percent in 2016, Apple has fallen to the number five brand in China, behind Huawei, Oppo, Xiaomi, and Vivo.

The average selling price in China of an Apple iPhone 6S with 16 gigabytes of storage is currently priced at $828.84. That compares to 649 in the U.S. In 2015. Despite the steep price for a Chinese consumer, Apple was named China’s favorite luxury brand in mid-2015, taking top honors away from Gucci and Louis Vuitton.

But with the February 24, 2016 launch of Xiaomi Mi 5 at $400, Apple faces a smartphone that is technically better-rated than the iPhone 6S. With twice the battery, 10 percent less weight, a more powerful processor than the Apple’s A9, and standard low-light with advanced optical stabilization camera, most analysts report that in comparison, Chinese users tend to report that the Mi 5 has a better feel than the iPhone 6S.

Xiaomi’s 50 percent lower price point versus Apple has not represented a global existential threat as an “iPhone Killer,” because the domestic Chinese have never had the patent rights to begin forming alliances with telecommunications firms in the U.S. and Europe.

But a new patent cross-licensing agreement with Microsoft now gives Xiaomi access to about 1,500 of Microsoft’s patents for voice communications, multimedia and cloud computing. In exchange, Xiaomi has agreed in exchange to install Microsoft’s Office and Skype software on all the smartphones and tablets it sells.

About 90 percent of the 70 million smartphones that Xiaomi built last year were sold in China. UK-based analyst Sameer Singh told Reuters, “This deal might just give them enough of a patent trove to move to Western markets.”

Apple’s average selling price for the iPhone 6S with 16 gigabytes of storage is about $839.76 in Europe and $649 in the U.S.. The ability of Microsoft and Xiaomi to bring a legal and competitive $400 smartphone to Western markets would seem to represents a huge threat to Apple’s profitability and its stock price.