The number of cars built in the UK has reached a 17-year high, but investment fell last year amid uncertainty over the future of the economy because of the impact of leaving the EU, new figures show.
Around 1.7 million cars rolled off production lines last year, an increase of 8.5% over the previous year, with exports reaching a record 1.35 million.
The Society of Motor Manufacturers and Traders said global demand for British-built cars increased by more than 10%, leading to four of every five cars built in this country being exported to one of 160 markets.
SMMT chief executive Mike Hawes predicted that car production will reach an all-time high before 2020, but he sounded a note of caution after revealing that investment by the industry fell to £1.66 billion last year, compared with £2.5 billion in previous years.
There were signs that firms were delaying investment decisions because of the greater uncertainty sparked by the referendum decision, he said.
The viability of the car industry was at stake, said Mr Hawes, adding that if tariffs were imposed after the UK leaves the single market, the price of cars could increase by £1,500.
"We don't want tariffs - it's a red line for the car industry. There would be an impact on demand and jobs - that's a cliff edge we want to avoid," he said.
"We want trade deals but they must be the right deals, not rushed deals. Failure to do so could damage UK automotive manufacturing beyond repair."
Most of last year's growth in car production was because of continuing economic recovery across Europe.
Exports to EU countries increased by 7.5% to 758,680, accounting for half of all exports.
There was also a big rise in car exports to the United States, where demand jumped by almost half, accounting for around 14% of all UK car exports.
Increases were also seen in Turkey, Japan and Canada, with a modest 3% rise in China, the SMMT reported.
The UK has 15 car plants, directly employing 169,000 workers and 814,000 across the sector.
Jaguar Land Rover increased production by 11% last year to 544,000, Nissan's rose by 6.5% to 507,000, the Mini by 4.9% to 210,000 and Honda by 12% to 134,000.
Production of Toyota models fell by 5% to 180,000.
The top 10 British best-sellers worldwide last year were the Nissan Qashqai, Toyota Auris, Mini, Vauxhall Astra, Range Rover Sport and Evoque, Land Rover Discovery Sport, Honda Civic, Jaguar F-Pace and Jaguar XE.
Business Secretary Greg Clark said: "Our modern industrial strategy will make the UK one of the most competitive places in the world to grow a business and these figures show why the UK automotive sector has such a vital role to play as we build on our strengths and extend excellence into the future.
"We are providing long-term investment and support, so that all our auto companies, and the vital supply chain it supports, can strive for even greater success in 2017."