Environment minister Michael Gove announced the move as part of the government's keenly-awaited 3 billion pounds ($3.9 billion, 3.4 billion euro) air pollution plan, which will demand that councils propose measures by March next year to reduce nitrogen dioxide (NO2) levels.
The ban on petrol and diesel cars as well as vans follows a similar proposal by the French government, and will also include hybrid vehicles that have an electric motor and a petrol or diesel engine.
"The Conservatives had a manifesto promise to ensure that by 2050 there would be no diesel or petrol vehicles on the road and today we're confirming that should mean no new diesel or petrol vehicles by 2040," Gove told BBC Radio 4.
Britain's High Court demanded that the government produce plans to tackle illegal NO2 pollution, largely caused by diesel emissions, and a draft report was published in May, but the full report was delayed by last month's snap general election.
The government will provide local councils with 255 million pounds to bring NO2 levels to legal levels, with possible solutions including the removal of speed humps, reprogramming traffic lights and changing road layouts.
Campaigners want cities to impose entry fees on diesel drivers, but councils will only be allowed to do so if no other measures are available, with ministers wary of "punishing" drivers of cars who bought their vehicles in good faith, according to media reports.
"Diesel drivers are not to blame and, to help them switch to cleaner vehicles, the government will consult on a targeted scrappage scheme, one of a number of measures to support motorists affected by local plans," a government spokesman said.
Gove added that he did not believe "that it is necessary to bring in charging."
Campaign group ClientEarth warned that health issues "caused by exposure to illegal air pollution are happening now, so we need urgent action."
Fellow campaigners Greenpeace also warned that the plans did not do enough to combat the immediate issue of NO2 pollution in cities.
"While this plan makes the right headline-grabbing noises, in reality it means that children across the UK will continue to be exposed to harmful air pollution for years to come, with potentially irreversible impacts," said Areeba Hamid, clean air campaigner at Greenpeace UK.
"Providing a long term vision is not enough, (Michael) Gove still needs protect our health right now from toxic fumes polluting our streets."
The Society of Motor Manufacturers and Traders (SMMT) said that the move could cost jobs.
"Currently demand for alternatively fuelled vehicles is growing but still at a very low level as consumer have concern over affordability, range and charging points," said SMMT Chief Executive Mike Hawes.
"Outright bans risk undermining the current market for new cars and our sector which supports over 800,000 jobs across the UK, we could undermine the UK's successful automotive sector if we don't allow enough time for the industry to adjust."
Air pollution contributes to the death of more than 40,000 people per year in Britain, according to official figures, with nitrogen dioxide a particular problem.
Norway, which is aiming to end the use of all cars running on fossil fuels by 2025, offers generous tax breaks for electric vehicles as well as free parking and the use of bus lanes.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)