For the past several months, President Donald Trump has been waging a costly trade war with China, which has had no shortage of ill effects on US farmers.

The president decided to use millions of American taxpayer dollars to bail them out — but that money may also end up helping Chinese-owned and foreign-owned agriculture companies operating in the US.

The US Department of Agriculture told the Washington Post this week that a Chinese-owned pork producer that operates in the United States, Smithfield Foods, qualifies for a government bailout check, and so does a Brazilian-owned pork producer called JBS. Both corporations are the two largest pork producers in the country.

The Trump administration cut more than $25 million worth of bailout checks to the agriculture industry in September, just a few months after the president announced a $12 billion aid package for US farmers coping with retaliatory tariffs that foreign countries have imposed on their products.

But now it’s clear that the tax subsidies won’t just help US farmers — they’ll help their foreign competitors too, and will likely benefit many of the countries Trump is supposedly targeting.

The news is the latest twist in the president’s trade war with China, which was supposed to help American workers and businesses but has been hurting them instead. Trump’s trade war is failing, and hurting the US economy, and he doesn't seem to care.

Trump’s tariffs on Chinese imports hurt American businesses, as predicted

Over the past year, America has slapped about $200 billion in tariffs on Chinese goods, in part to make Chinese products more expensive so Americans don’t buy them. The administration has also placed steep tariffs on all imported steel, angering other major US trade partners.

The idea was to level out the trade deficit and make China buy more US goods, but, as expected, China responded by slapping its own tariffs on American imports.

Trump’s protectionist trade agenda ended up hitting American farmers the hardest, with foreign countries levying tens of billions of dollars in retaliatory tariffs on the American agricultural industry. China, Mexico, and Canada have responded to the Trump administration’s taxes on imported steel, aluminum, and electronics with taxes on American soybeans, dairy, pork, apples, and potatoes, among other American goods.

As Vox’s Tara Golshan explains, the impact on the US agriculture industry is no joke. Prices for agricultural products like soybeans have dropped to a 10-year low since Trump imposed sweeping tariffs on trade and aluminum earlier this year. And farmers across different markets have grown increasingly nervous about how their businesses will fare if the trade war continues.

That’s when Trump surfaced the idea of a government program that would reportedly stabilize the agriculture industry in three ways: giving farmers direct cash assistance, buying surplus crops and giving them to food banks, and a vague trade promotion program.

The stabilization package will use a Depression-era program that allows the government to borrow up to $30 billion from the Treasury without congressional approval, according to the Washington Post. In September, the Agriculture Department sent farmers $25.8 million in aid. It’s unclear how many foreign companies operating in the US are also getting some of that cash.

The trade war hasn’t reduced the trade deficit with China

Trump has repeatedly stated that his trade policies are meant to target China, which sells way more goods to the United States than it buys from America.

But as Vox’s Alex Ward points out, the US has a lot more to be angry about:

Trump’s strategy has focused on efforts to cripple the Chinese economy at all costs, while disregarding the impact on the US economy. That includes placing tariffs on more than $200 billion worth of Chinese goods in the past year, which makes Chinese products more expensive — and therefore less appealing — to American consumers and businesses.

But Beijing has responded with its own tariffs on American goods, and the country has stopped buying as much from US manufacturers. So the trade imbalance between both countries is now worse.

In September, America’s trade deficit with China reached a new high: $34.1 billion. That’s a 13 percent increase compared to last year. Ford, America’s second-largest car company, said in August that Trump’s tariffs cost the company $1 billion, and the company now expects massive layoffs.

This impact of Trump’s trade policies is striking, considering how often he repeated that his goal is to boost US manufacturing. His trade war might help the small US steel industry, but it’s hurting nearly every other sector of the US economy. And now taxpayers are stuck with the bill of Trump’s $12 billion bailout.