(Refiles to remove extraneous word in last paragraph)
By Hallie Gu and Michael Hirtzer
BEIJING/CHICAGO, July 27 (Reuters) - Over the past few months, Chinese mills have bought every cargo of soybeans they can lay their hands on to prepare for Beijing's imposition of hefty tariffs on U.S. imports.
Now, at least 20 factories - including two of China's largest - have cut or suspended output in the most widespread cuts in years, capitulating to record stockpiles of soymeal and a punishing year-long slump in demand from hog farmers.
In contrast, factories across the farmbelt of the U.S. Midwest are enjoying a boom, turning in near-record profits as sinking demand from China, which typically buys half of U.S. soybean exports, hands them an unexpected bounty of cheap beans.
Archer Daniels Midland, with roughly half of its $14.1 billion global oilseed crushing business based in North America, has been benefiting from strong processing margins at home, traders and analysts said.
Processors crush soybeans to make food oil and meal for animal feed.
The two scenarios illustrate the diverging fortunes for the world's top agricultural sectors as Washington and Beijing remain locked in a high-stakes trade dispute.
They will also likely stir concerns that Beijing's use of soybeans to hurt U.S. farmers may be backfiring by inflicting financial pain at home.
Washington this month imposed tariffs on $34 billion of Chinese imports. In return, China levied taxes on the same value of products from the United States, including soybeans. Trump has also threatened further tariffs on $200 billion in Chinese goods.
Soybeans are a powerful tool in Beijing's arsenal because they were the United States' biggest agricultural export to China, worth $12 billion last year. Farm states like Iowa also backed U.S. President Donald Trump in the 2016 election.
U.S. farmers have already seen incomes decline for four straight years due to a global grain glut.
On Tuesday, U.S. President Donald Trump pledged $12 billion in aid to help farmers weather the trade war.
But a prolonged slowdown in buying from the world's top bean importer will raise concerns even in Brazil, an early beneficiary of the trade war as the grower sought to fill a gap left by the United States.
PAIN IN RIZHAO
China's vast soybean crushing industry - the world's largest - is paying a heavy price for the trade war.
From Shandong province in the east to Guangxi in the south, factories have struggled for the past year with sinking demand for animal feed as pig farmers cull herds because of declining meat prices. China is the world's largest pork consumer.
But in recent weeks, mills representing more than 80,000 tonnes per day of crushing capacity, or over 20 percent of the nation's total, have closed temporarily or curbed output, according to an analysis by Cofeed, an agribusiness research firm.
Seasonal cuts are common when stocks are high, but four executives at crushers and two industry analysts say the pace is quicker and lasting longer than before because they are sitting on record soymeal stockpiles (CFD-SBMST-NATN).
"Usually, it takes a couple of weeks to work through the inventories and then crushers resume operations. But this time, it is expected to take a month," said Xie Huilan, an analyst at Cofeed.
The pain will be particularly acute in the port city of Rizhao in Shandong, a major crushing hub, where six major factories process 24,500 tonnes of beans a day.
Crushers there (CNSOY-RZO-MRG) have seen losses deepen since Beijing threatened in April to impose the extra tariffs on U.S. soybeans. They are currently losing 171 yuan ($25.15) for every tonne of soybeans they crush, equivalent to 4.2 million yuan a day.
Last week, a Rizhao-based soybean crusher and importer, Shandong Sunrise Group, filed for bankruptcy.
The cuts include privately owned Shandong Bohi Industry Co Ltd, which last week suspended a 5,000 tonne-per-day line at its plant in Qingdao, Shandong, for eight days, according to Cofeed and a source briefed on the matter.
Another major processor, the state-owned Jiusan Group, this month suspended or cut operations at three of its plants with combined daily capacity of 15,000 tonnes in the northeastern provinces of Jilin and Liaoning to work through high soymeal inventories, according to Cofeed.
Calls to Bohi and Jiusan went unanswered.
A manager at a northern crusher said he ramped up purchases of Brazilian beans to protect supplies as the trade war escalated, and had to scramble to process them before they went mouldy due to hot temperatures.
On Tuesday, he suspended operations until he can sell his meal.
"We bought too many Brazilian beans. Now they are arriving all at once," he said.
Like the other executives interviewed by Reuters, he declined to be identified.
MORE AT HOME
This week, China cancelled 165,000 tonnes of U.S. soybean purchases that would have been shipped in the season beginning on Sept. 1. The country has not booked a bulk cargo of U.S. soybeans since May.
That has been a bonanza for U.S. crushers.
With domestic soybean prices at their lowest in a decade, margins measured by the Chicago Board of Trade reached $2.20 per bushel on July 12, the second-highest on record.
"It's been historic. We've made a killing on it," said a U.S. soy products trader at a publicly listed company.
Adding to those gains, a drought in Argentina, the top exporter of soymeal and soyoil, cut the soy harvest there, pushing more hog and poultry producers in Asia and Europe to buy high-protein soy animal feed from the United States.
China's factories will pick up the pace once inventories have been whittled down as farmers seek more meal to fatten herds ahead of the Mid-Autumn Festival.
But the financial pain is likely to worsen if crushers have to buy more expensive U.S. soybeans once Brazil's crop has run dry and the pig industry remains weak.
"We didn't expect demand to be so bad this year," said a manager at a crusher that closed temporarily last weekend.
"We wouldn't stop if we had a choice. I feel it's a nationwide problem."
($1 = 6.7984 Chinese yuan renminbi)
(Writing by Josephine Mason; Editing by Philip McClellan)