It’s unclear whether US president Donald Trump’s unconventional proposal to use tariffs to stop immigration from Mexico would work. What is more certain is it would hurt the US economy, according to a new study by a Texas-based economic research firm.

Last week, Trump said he would impose a 5% tax on imports from Mexico starting June 10 unless Mexican authorities prevent immigrants from illegally crossing into the United States. That would cost the US economy $41.5 billion a year and result in 400,000 job losses a year, the report estimates.

Perryman Group, which specializes in Texas economics, measured how the extra costs would affect demand and supply. The tariffs would hit the Lone Star state especially hard, as Mexico is by far its largest trading partner.

Here’s the break-up by industry of the whole country:

Most of the losses would be the result of higher prices for imported goods, much of which would be absorbed by buyers. In Trump’s ongoing trade war with China, it has so far been US consumers, not foreign manufacturers, who have ended up paying.

Tariffs on Mexico could potentially be even more disruptive, because the United States doesn’t just buy finished products from its southern neighbor. Much of the trade between the two countries is in raw materials and parts that cross the border multiple times before becoming things like cars and jeans. US customs authorities would charge the 5% tax every time.

Perryman’s estimate doesn’t take into account the effects of retaliatory measures Mexico would likely take in response. And Mexican authorities are particularly savvy in targeting products to inflict political pain. Take cranberries, which they included in their list of retaliatory taxes back when Trump’s steel and aluminum tariffs came into effect. Wisconsin, the home state of then House speaker Paul Ryan, grows the bulk of US production of the fruit.

The trade fight could also derail the US-Mexico-Canada agreement, the deal Trump negotiated to update the existing pact between the three countries, known as NAFTA. Mexican lawmakers, who still need to sign the the new agreement, might feel less inclined to do so given Trump’s attacks. That would have its own economic fallout. It would also be a loss for Trump, who has touted it as one of his biggest trade policy achievements.

“All in all, the potential economic harm from tariffs on imports from Mexico totals tens of billions in gross product and hundreds of thousands of jobs, but the fallout could be much greater over time,” Perryman wrote.