By Dominique Patton and Josephine Mason

BEIJING (Reuters) - On the surface, the timing of the United States' audacious challenge to China's price supports for its grain farmers looks odd.

Farmers in the world's second-biggest economy are currently harvesting their first corn crop in a decade that will not be priced by the government, after Beijing launched efforts to reform its corn policy earlier this year. Furthermore, domestic Chinese corn prices are languishing close to multi-year lows.

But the steady erosion of the U.S. role in the world grain export market, a ballooning global crop glut and the years-long premium that Chinese grains have held over global prices help to explain what compelled the politically influential U.S. farm sector to file its case with the World Trade Organization.

European and U.S. regulators have criticized China's farm policies for years but the country's leaders have prioritized the sector to ensure self-sufficiency in staple food crops and boost rural incomes to address widening inequalities with urban residents. To do that, Beijing has set goals to provide jobs across the farm belt, feed its growing urban population and reduce its dependence on imports.

The U.S. appears willing to risk ratcheting up tensions in an already-fraught trade relationship as its own farmers grapple with record grain inventories and near 10-year lows in grain prices.

The two countries, the world's biggest agricultural producers, are already enmeshed in ongoing bilateral trade deal discussions and a Chinese investigation into alleged dumping of animal feed grains by U.S. producers. These tensions are what analyst Rosa Wang at Shanghai JC Intelligence Co Ltd believe sparked the U.S. action.

"It's totally related to the trade relationship," said Wang.

A ruling in the dumping case against U.S. producers of distillers's dried grains with solubles (DDGS), an animal feed made as a byproduct of ethanol production, was expected earlier this week.

FALLING CLOUT

Part of the U.S. pain is explained by an historic shift in trade flows.

Between 2010 and 2015, the U.S. share of the burgeoning volumes of global exports of corn, wheat and rice shrank by a third as it was crowded out by rivals Brazil, Argentina and Russia, according to data compiled by Reuters.

Its portion of sales to China fell even faster, dropping by over 40 percent.

An even larger sticking point in the controversy centers on the difference in prices for grains between China and the United States that started to widen in early 2010.

The United States says the spread distorts world trade and gives Chinese farmers an unfair advantage over competitors.

Spot futures prices of wheat and rice in China averaged more than double their U.S. counterparts in August. Dalian corn prices were an average 1.7 times higher than Chicago corn prices.

UNINTENDED CONSEQUENCES

Criticizing China's subsidies and forcing Beijing to overhaul its system may have unintended, painful consequences for U.S. farmers, analysts say.

They point to corn as an example.

Domestic Chinese corn shot to premiums over global prices after government help and that created huge opportunities for exporters to sell into China in recent years. In 2015, the country imported 4.7 million tonnes of corn as domestic prices averaged nearly 1,300 yuan ($195) per tonne more than the U.S. benchmark.

But, as China has dismantled its corn stockpiling and decade-old price support program this year, the spread in corn has dropped by roughly 30 percent to around 900 yuan per tonne.

And with that drop China's appetite for foreign corn has collapsed, falling 22 percent through July compared to the same period last year.

Ma Wenfeng, a senior analyst at Beijing Orient Agribusiness Consultant Ltd, said on Wednesday that China's waning import appetite with the ending of the state support system was a bigger worry for the United States.

"It's because China doesn't support (it's corn farmers anymore)" that U.S. imports have dropped, he said.

(Editing by Christian Schmollinger)