New York(CNN Business) The Trump administration's expansion of the global trade war to Mexico could have harsh economic consequences for American workers — especially in Texas.

If the 5% US tariff on all goods from Mexico takes effect and is maintained, more than 400,000 jobs in the United States could be lost, an analysis released this week found.

The tariffs on Mexico, set to go in effect on Monday, would cost Texas alone more than 117,000 jobs, according to the analysis by The Perryman Group, an economic consulting firm. Texas is Mexico's largest export market, making the two economies closely intertwined.

The findings underscore the economic gamble President Donald Trump would be taking by imposing tariffs on Mexico, which is now America's largest trading partner, after taking into consideration the recent China tariffs. Trump threatened to escalate tariffs on Mexico if the country does not step up its immigration enforcement actions.

"To impose tariffs on all goods from our largest trading partner will cause significant cost increases and other harms to the economy," Ray Perryman, the CEO of the Perryman Group, wrote in the report. "The fallout could be much greater over time."

Perryman, who has a PhD in economics from Rice University, has advised dozens of America's largest companies, including big banks and energy companies. He has authored hundreds of academic papers over the past four decades.

Major Wall Street firms have not yet released estimates on job losses from the tariffs on Mexico, reflecting the surprise nature of the trade tensions.

Manufacturing, retail jobs in the crosshairs

Most of the economic pain would hit the retail trade sector, which includes everything from clothing and furniture stores to restaurants and auto parts dealers. That industry stands to lose 136,516 jobs, Perryman found.

And more than 50,000 jobs could disappear from the manufacturing industry, the sector that Trump has promised to prop up in part through his aggressive trade agenda.

"Free trade is clearly beneficial," Perryman wrote. "Basic economic theory and centuries of evidence support this fact."

The economic pain would be even greater, Perryman warns, if Mexico retaliates by imposing tariffs of its own, causing a decline in American exports.

It's important to note that the analysis does not include the economic consequences of Trump carrying out his threat to lift tariffs on Mexico up to 25%. Nor does it include job losses caused by the escalating trade war between the United States and China, the world's two largest economies.

Could this spark a recession? Yes

Gus Faucher, chief economist at PNC, said that the estimate of 400,000 job losses in some ways overstates the impact — and in other ways, underestimates it.

Faucher noted that the analysis does not account for job gains caused by a forceful response from the Federal Reserve, which could slash interest rates if the economy suffers. But he said those job gains would probably be in lower-earning positions than the ones lost by the tariffs on Mexico. Faucher also noted that 400,000 jobs only represents 0.3% of total US employment, or about two months of job growth at the 2019 pace.

The bigger picture: Well more than 400,000 jobs could disappear if the trade tensions with Mexico and China escalate to the point that they threaten the economic expansion.

"It's easy to see how this could turn into a recession that results in significant job losses," Faucher said. "This is a negative for the US economy. It's a bad idea."

The 400,000 job loss estimate could prove to be conservative if the 25% tariffs on Mexico go into effect and were sustained, said Russell Price, senior economist at Ameriprise, said in an email.

"The economic pain of getting to that level however, very likely precludes it from happening," Price said.

Bank of America on Tuesday warned of a "sizable slowdown" in the US economy due to the trade war. The bank slashed its forecast for US GDP growth for the second half of 2019 to 1.2%, compared with 1.8% previously.

"We think things are going to get worse with more pain to the global economy before a deal can be reached with either China or Mexico," Ethan Harris, Bank of America's global economist, wrote in a report to clients.

$28 billion in direct costs

The tariffs on Mexico would lead to an increase in direct costs of about $28.1 billion each year — costs that would spread throughout the economy, Perryman found. Including multiplier effects, the US economy would lose an estimated $41.5 billion in GDP for each year the tariffs are in place.

Trump's threatened tariffs on Mexico have alarmed business groups, investors and lawmakers — including many in his own party. The Business Roundtable warned that the tariffs would be a "grave error" that would create "significant economic disruption."

Mexico plays a vital role in the US auto industry, which depends on Mexican parts.

Imposing the full 25% tariff that Trump has threatened would increase the price of vehicles sold in the United States by an average of $1,300, according to an estimate by Deutsche Bank.

Officials from the United States and Mexico have entered negotiations, raising the hope that a deal can be reached to avert the tariffs.

Peter Navarro, a hawkish trade adviser to Trump, told CNN on Wednesday that the tariffs on Mexico "may not have to go into effect" because "we have the Mexicans' attention."