Microsoft Corp has been ordered by a Chinese court to stop selling versions of its Windows operating systems that include fonts designed by a local company, citing a violation of licensing agreements.

The ruling, issued by Beijing's No. 1 Intermediate People's Court on Monday, is a blow for Microsoft as it seeks to expand its market share in China where it already faces problems of rampant software piracy.

In its ruling, the court said Microsoft violated the scope of licensing agreements between it and a Chinese technology company, Zhongyi Electronic, which designs Chinese character fonts.

Microsoft will have to stop selling the Chinese versions of its Windows 98, 2000, 2003 and Windows XP, according to the court. It is unclear when the ruling will take effect or how many copies are affected.

Microsoft said it will appeal the ruling.

Microsoft respects intellectual property rights. We use third party IPs only when we have a legitimate right to do so, the firm said in a statement.

Zhongyi Electronic said in a statement on its website that the agreements signed only permitted Microsoft to use its intellectual property in Windows 95, but that the U.S. tech giant used it in subsequent versions of its Chinese Windows operating systems.

China has long been the target of foreign firms seeking to protect their intellectual property, but roles are fast reversing as Chinese firms mature and become more aggressive in protecting their own designs.

By winning this case against an internationally well-known company like Microsoft, it shows that China, although still a developing country, is taking positive steps to protect intellectual property rights, said Ling Xin Yu, the lawyer for Zhongyi told Reuters.

Indeed, more litigation by Chinese companies is likely, according to Michael Vella, head of China litigation and intellectual property rights at Morrison & Foerster LLP.

(Chinese firms) are going to think of China as a place to have their own litigation strategy, I think that's a trend that's coming, said Vella.

We saw it in Taiwan -- at first, Taiwanese companies were always on the defensive, and in recent years we have seen them initiating litigation.

(Reporting by Melanie Lee, editing by Don Durfee and Ian Geoghegan)