London (CNN Business) The British car industry has been written off before. It now faces its biggest challenge since the 1970s.

Falling global demand for cars meant less work for British factories and the 168,000 people they employ. But Britain's lurch towards the EU exit is also hurting output and costing hundreds of millions of dollars.

The dire figures from the UK Society of Motor Manufacturers and Traders come days after the group's CEO issued a stark warning to Prime Minister Boris Johnson: Leaving the European Union without a deal on October 31 could doom the British car industry.

"A no-deal Brexit presents an existential threat to our industry," Mike Hawes wrote in a letter to the new prime minister. "We are highly integrated with Europe, and a no-deal Brexit would result in huge tariff costs and disruption that would threaten production."

Carmakers have already spent £300 million ($365 million) to mitigate the risks from a disorderly exit, according to SMMT. That's more than three times the £90 million ($110 million) they invested in the first six months of the year. In recent years, annual investment has totaled £2.7 billion ($3.3 billion).

"Today's figures are the result of global instability compounded by ongoing fear of 'no deal'," Hawes said in a statement on Wednesday. "This fear is causing investment to stall, as hundreds of millions of pounds are diverted ... money that would be better spent tackling technological and environmental challenges."

Production has declined for 13 consecutive months because of weak demand in key markets and temporary factory closures that were pulled forward in anticipation of Brexit.

Nissan cars are pictured near the company's plant in Sunderland, England.

But that's nothing compared to disruption that would be caused if Johnson follows through on his threat to leave the European Union without a deal, ending tariff-free trade with a market that takes 57% of British car exports. That would snarl the supply chains that carmakers depend on, disrupt production and erode profit margins that are already razor thin.

According to SMMT, tariffs alone would cost £4.5 billion ($5.5 billion) a year. It estimates the industry would lose £50,000 ($63,300) a minute.

Saved by Japan

The UK carmaking industry has faced long odds before, only to be revived with help from savvy political maneuvering that convinced Japanese carmakers that they could use Britain as a base to sell cars into the European Union's vast unified market.

British brands struggled to compete with foreign rivals throughout the 1970s, when the industry produced cars of dubious quality and companies suffered from protracted battles with labor unions. Difficulties continued even after the industry was partly nationalized in 1975 under British Leyland, a company that was kept afloat with billions of pounds provided by taxpayers.

Honda HMC Toyota TM Yet productivity and quality began to improve following the arrival of Nissan, which became the first Japanese carmaker to open a plant in Europe when it set up a factory in the English city of Sunderland in 1986. Its entry followed an intense lobbying campaign by former Prime Minister Margaret Thatcher, who urged the company to use Britain as a gateway to the EU market she had helped to create.andwould later open UK factories of their own.

The car sector is now one of the most productive industries in the United Kingdom, and the single biggest exporter of UK goods, accounting for 14% of total exports. Salaries are 40% higher than the national average.

The cuts have started

Crashing out of the European Union puts that success in huge doubt. Carmakers have endured three years of uncertainty over the future terms of trade with Europe, but many are now being forced to make tough choices as the industry undergoes seismic changes demanded by the shift to electric and autonomous driving. Japan has also signed a free trade deal with the European Union that reduces barriers for its car exports.

Nissan NSANF Honda is planning to shut down a major factory in England that employs 3,500 people. The plant currently makes up to 150,000 Civics a year for over 70 countries.has scrapped plans to build its new X-Trail SUV at its factory in Sunderland. It said uncertainty over Brexit was partly to blame.

PSA PUGOY French carmakerhas warned that continued production of the Vauxhall and Opel Astra in the United Kingdom depends on the country's terms of trade following Brexit. It's the only model currently produced at the group's factory near Liverpool. "Decisions to come are key for the site," a spokesperson said this week.

Ford F said in June that it will close an engine plant in Wales by 2020. While the US company said the decision was not related to Brexit, it had previously warned of dire consequences from a messy exit.

The industry has been bolstered by one piece of good news. Jaguar Land Rover, which is owned by India's Tata Motors, said earlier this month that it plans to make a new range of electric vehicles in Britain. But that won't be enough to save the industry from a bad Brexit.

"We need a deal with the European Union that secures frictionless and tariff free trade," Hawes wrote in his letter to the prime minister. "No-deal Brexit is simply not an option."