Ministers had to set out their draft clean air strategy plans in May, with the final measures due by 31 July.

Charging plans?

Environment Secretary Michael Gove said the government would give more than £200m to local authorities to draw up plans to tackle particular roads with high pollution.

"What we're saying to local authorities is come up with an imaginative solution to these proposals," he told the Today programme.

Asked if there could be charges for drivers of certain vehicles he said: "I don't believe that it is necessary to bring in charging, but we will work with local authorities in order to determine what the best approach is."

Industry interests

Local measures could include altering buses and other transport to make them cleaner, changing road layouts, altering features such as speed humps, and re-programming traffic lights to make vehicle-flow smoother.

It is thought ministers will consult on a scrappage scheme later this year, but there is no firm commitment.

Ministers have been wary of being seen to "punish" drivers of diesel cars, who, they argue, bought the vehicles after being encouraged to by the last Labour government because they produced lower carbon emissions.

The industry trade body, the Society of Motor Manufacturers and Traders, said it was important to avoid outright bans on diesels, which would hurt the sector.

SMMT chief executive Mike Hawes said: "Currently demand for alternatively fuelled vehicles is growing but still at a very low level

"The industry instead wants a positive approach which gives consumers incentives to purchase these cars. We could undermine the UK's successful automotive sector if we don't allow enough time for the industry to adjust."

The UK announcement comes amid signs of an accelerating shift towards electric cars instead of petrol and diesel ones, both at home and abroad:◾Earlier this month, President Emmanuel Macron announced similar plans to phase out diesel and petrol cars in France, also from 2040.◾BMW announced on Tuesday that a fully electric version of the Mini will be built at the Cowley plant in Oxford from 2019.◾Swedish carmaker Volvo has said all new models will have an electric motor from the same year.

The government plan will not contain a vehicle scrappage scheme, although this will be reconsidered in the autumn.

And it won't yet mandate councils to charge dirty vehicles to enter cities, unless they fail to solve pollution by other means - such as better public transport and restrictions barring diesel vehicles at peak times.

Ministers were ordered by the High Court to produce a comprehensive clean air strategy by the end of this month.

Today's plan is not comprehensive - it doesn't address pollution from construction, farming and gas boilers.

But ministers argue it is better to have a scheme for tackling the worst pollution hotspots rather than rushing out a botched comprehensive strategy.

Clean air campaigners say the government is using the 2040 electric cars announcement to distract from failings in its short-term policy.

Read more analysis from Roger

Air pollution is thought to be linked to about 40,000 premature deaths a year in the UK, and transport also contributes to greenhouse gas emissions.

A government spokesman said poor air quality was "the biggest environmental risk" to public health in the UK.

"This government is determined to take strong action in the shortest time possible," he said.

"Our plan to deal with dirty diesels will help councils clean up emissions hotspots - often a single road - through common sense measures which do not unfairly penalise ordinary working people."

2020s switch-over

The measures are "good" in the long term but "not very effective" in the short, industry expert David Bailey said.

A switch-over to electric cars would likely come in the mid-2020s, he predicted, when electric cars would out-compete petrol and diesel ones on factors like cost.

"This sets a very clear direction of travel, but petrol and diesel cars won't exist by 2040," he said.

But he said more incentives were needed now, otherwise urban air quality would not improve.

Emissions hotspots

Environmental law firm ClientEarth welcomed the measures, but said it wanted to see more detail.

Its chief executive James Thornton said the law said ministers must bring down illegal levels of air pollution as soon as possible, so any measures must focus on that

Labour said the government was only acting after being taken to court.

Environment, Food and Rural Affairs spokeswoman Sue Hayman MP said the government had a "squeamish" attitude to clear air zones, and was shunting the problem on to local authorities.

"With nearly 40 million people living in areas with illegal levels of air pollution, action is needed now, not in 23 years' time," she said.