Boris Johnson made the pledge as part of plans for a "green industrial revolution" that he claims could create up to 250,000 jobs in energy, transport and technology.
The government said sales of new gasoline and diesel cars and vans will end in 2030, though hybrid vehicles can be sold until 2035.
Automakers have expressed concern about the target, saying the previous goal of 2040 was already ambitious.
The government's green plans also include investments in hydrogen energy and carbon capture technology, and an ambition to generate enough wind energy to power every home in the U.K. by 2030. To the chagrin of some environmentalists, plans also include a new generation of nuclear power plants.
The environmental push is part of Johnson's efforts to move beyond the tremors of the coronavirus pandemic and Britain's divisive exit from the European Union, and to bring new jobs to struggling former industrial regions of central and northern England.
"Although this year has taken a very different path to the one we expected, I haven't lost sight of our ambitious plans to level up across the country," Johnson said in a statement.
"Our green industrial revolution will be powered by the wind turbines of Scotland and the North East, propelled by the electric vehicles made in the Midlands and advanced by the latest technologies developed in Wales, so we can look ahead to a more prosperous, greener future."
Johnson also has made a shared commitment to fighting climate change part of his pitch to Joe Biden as he seeks to convince the U.S. president-elect he is not a carbon copy of Donald Trump, who has downplayed the threat posed by global warming.
The U.K. is due to host the COP26 global climate conference next year, after a 12-month delay because of the coronavirus pandemic. Britain has also pledged reduce its carbon emissions to net zero by 2050.
Rebecca Newsom of Greenpeace U.K. said the "landmark" announcement was a big step forward, although she regretted the inclusion of "speculative solutions, such as nuclear and hydrogen from fossil fuels, that will not be taking us to zero emissions anytime soon, if ever."