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.5 million 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.
Diesel vehicles produce the overwhelming majority of nitrogen oxide gases coming from roadside sources.
Analysis: Theo Leggett, BBC business correspondent
It's fair to say 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.
So you could argue that carmakers really have themselves to blame.
Diesel car sales fell by almost a third in December after November's Budget which introduced a levy on new diesel cars that failed to meet the latest emissions standards.
Experts said the one-off tax increase - which comes into effect in April - would be applied to most new diesels.
Mr Hawes said that for many drivers, diesel was still "the best bet because they can save a lot of money and indeed have a lower CO2 emission".
"The backlash against diesel has made it far harder for us - and the government - to meet our climate change targets," he said.
A government spokesperson said: "Our ambitious Clean Growth Strategy sets out the UK's position as a world-leader in cutting carbon emissions to combat climate change while driving economic growth.
"This includes investing nearly £1.5bn in accelerating the rollout of ultra-low emission vehicles by 2020 - generating business opportunities and leading to cleaner air and lower greenhouse gas emissions."
Sales of alternatively fuelled vehicles, including electric and hybrid vehicles, saw a rise of 34.8% to almost 120,000.
Environmental campaigner Tony Juniper told the BBC's Today programme that demand for electric cars was increasing "at a rate that's defying predictions that were being made five or 10 years ago".
"Partly this is being driven by the kinds of awareness around air pollution, but also climate change," he added.
However, Mr Hawes told the programme that while electric cars were seen as the future, they still accounted for a very small proportion of total sales.
Out of the 2.5 million vehicles sold in the UK in 2017, just 13,500 were battery electric, he said.
"It's growing, it's growing rapidly, but you can see the scale of the challenge," he added.