The UK government is to ban the sale of all new diesel and petrol cars and vans from 2040 as part of efforts to tackle air pollution, according to reports.

Environment Secretary Michael Gove will announce the ban when he releases a final document outlining the government's clean air strategy on 26 July, the Guardian newspaper reported.

A £3bn ($3.9bn) package is expected to be unveiled to combat air pollution, including a £255m fund to help councils deal with pollution from diesel vehicles.

The measures come weeks after a similar commitment by France to ban all diesel and petrol cars by 2040 in order to meet its obligations under the Paris climate accord.

Air pollution is estimated to contribute to the shortening of the lives of around 40,000 people in the UK per year, primarily by worsening the health of those with heart or lung problems.

The government had been ordered by the High Court to come up with measures to tackle high levels of nitrogen dioxide pollution, which is largely caused by diesel vehicles, by 31 July.

A draft document put forward by ministers to combat the issue earlier this year was deemed to be too weak by a judge.

All newly bought cars in the UK will have to be electric within a quarter of a century Getty Images

"Poor air quality is the biggest environmental risk to public health in the UK and this government is determined to take strong action in the shortest time possible," a government spokesman was reported as saying.

"That is why we are providing councils with new funding to accelerate development of local plans, as part of an ambitious £3bn programme to clean up dirty air around our roads."

Gove will set out plans to bring air pollution back to within legal limits in cities such as London and Glasgow, and is expected to order councils managing the most polluted roads to outline how they plan to improve air quality.

The measures could include retrofitting buses and other public transport, changing road layouts and altering features such as roundabouts.

Taxes could also be introduced as a last resort to charge vehicles that enter "clean air zones" at certain times during the day.

Traditional fossil fuel cars account for around 95% of the European market, while less than 1% of the cars currently sold in the UK are fully electric.