China vowed on Wednesday to appeal a recent World Trade Organization ruling against its raw materials export policy, a case that could threaten Beijing's handling of rare earths.

In July, a WTO legal panel dismissed China's claim that its system of export duties and quotas on raw materials -- used in the production of steel, electronics and medicines -- served to protect its environment and scarce resources.

That ruling was a victory for the United States, the EU and Mexico, which took China to the WTO in 2009, saying export restrictions on raw materials including coke, bauxite and magnesium discriminated against foreign manufacturers and gave an unfair advantage to domestic producers.

First, we will make an appeal. Second, we still think Chinese practice and policies do not violate WTO rules, Ministry of Commerce spokesman Shen Danyang told a news conference when asked whether Beijing would file an appeal.

Shen's comments were the first official acknowledgment that China plans to appeal by the early September deadline, although experts had seen such a move as a foregone conclusion.

The WTO ruling was seen as a potential precedent against China's stance on its exports of 17 rare earth minerals.

China produces 97 percent of the world's supplies of the crucial industrial inputs, and has begun cutting exports, to the dismay of importers.

NEAR MONOPOLY PRODUCTION

Beijing has long held that its rare earth policies are in compliance with WTO rules, and that restrictions are important in conserving its natural resources and protecting its environment.

But importers, including those in the United States and Europe, have complained that China's rare earth policy is unfair, with uneven quotas on exports and domestic consumption of the valuable minerals.

Some countries have argued that China has taken advantage of its near monopoly production of rare earths and slashed exports to drive up prices without effectively limiting domestic production and consumption.

U.S. and EU officials have speculated about filing a complaint against China at the WTO, and some experts have suggested they may be waiting on the raw materials appeal to run its course before borrowing it as precedent.

Wang Jiangyu, a law professor and WTO expert at National University of Singapore, said China was unlikely to win the appeal, and despite a legitimate need to protect its environment it would likely lose any rare earths case because of its discriminatory export measures.

It is unclear what grounds the raw materials appeal might take, but China has asserted in the past that under article 20 of the General Agreement on Tariffs and Trade a country can limit exports for special purposes such as conservation.

Wang said a significant point in the WTO panel decision was that the special nature of China's WTO accession protocol means it is not entitled to invoke article 20.

That makes China's WTO accession agreement an unequal treaty. All the countries can do it, but only China cannot. That is a bit absurd, he said.

But even if it were to win that point on appeal, it would not mean a reversal in the case, given China's use of protectionist measures, Wang said.

If you are going to argue on environmental grounds, you would have to have been even-handed in the past and applied the same constraints at home, said Chin Leng Lim, a professor of law at the University of Hong Kong.

China says it is going to great pains to consolidate and rein in its polluting rare earths industry.

Five years ago you would say China had no experience even arguing a case. They are learning as they go along and now they have learned something about article 20, Lim said.

(Editing by Ken Wills and Yoko Nishikawa)