New car sales fell for the first time in six years last year, with demand for diesel cars plunging by almost a fifth.
In total, there were about 2.5mn cars registered, according to industry body the Society of Motor Manufacturers and Traders (SMMT).
The figure was down 5.7% from 2016, while diesel sales fell 17.1% as higher taxes and pollution fears hit demand.
CO2 emissions from new cars increased for the first time in 20 years, up 0.8% on 2016.
SMMT chief executive Mike Hawes said the drop in diesel sales was "the prime cause" of the rise in CO2 emissions and that the latest low-emission diesels were "vital" in meeting climate change targets.
He said he expected car sales to continue to drop this year, predicting a 5% to 7% fall.
Mr Hawes blamed the sales fall on declining business and consumer confidence, but pointed out last year's performance followed two years of record sales. "We need to put it into context. This was still the third best year in a decade and the sixth best ever," he added.
Mr Hawes said that confusion about the future of diesel had fuelled a backlash against diesel cars as they produce the overwhelming majority of nitrogen oxide gases coming from roadside sources.
Theo Leggett, BBC business correspondent, said that the steep decline in demand for diesel cars is causing both frustration and consternation within the motor industry.
The industry needs to sell diesels, because they are generally more fuel-efficient than petrol cars and therefore produce less carbon dioxide.
That helps car companies to meet targets for reducing CO2, introduced in order to combat climate change.
But concern about the level of nitrogen oxides (NOx) they produce has made them a favourite target for clean air campaigners.
The industry talks about a short-sighted backlash against new technology, which is encouraging people to stick with older, dirtier cars - and preventing sales of newer, cleaner models.
But it's worth remembering where the backlash against diesel really began: with the VW scandal. It didn't just expose deliberate wrongdoing at one company, it also showed how many diesel cars, which had passed official tests, were routinely producing much higher levels of toxic emissions when driven on the roads.
Mr Hawes said: "The backlash against diesel has made it far harder for us - and the government - to meet our climate change targets."
Sales of alternatively fuelled vehicles, including electric and hybrid vehicles, saw a rise of 34.8% to almost 120,000.
However, Mr Hawes told that while electric cars were seen as the future, they still accounted for a very small proportion of total sales. Out of the 2.5mn vehicles sold in the UK in 2017, just 13,500 were battery electric, he said.