The ban had been planned for 2040 but has been brought forward under Boris Johnson’s 10-point plan to tackle climate change.
The plan also includes producing enough offshore wind to power every home, developing the first town heated entirely by hydrogen by the end of the decade, and developing the next generation of small and advanced nuclear reactors.
Currently fewer than 1% of cars on UK roads are powered entirely by electricity, so the prime minister’s plan to end the sale of new petrol and diesel cars will require an enormous investment in the infrastructure needed for electric vehicles.
Edmund King, president of the Automobile Association, told Sky News only about 6% of local authorities have installed on-street charging facilities in residential areas.
Without a commitment to developing the right infrastructure, the plan was “optimistic”, he said.