From 2040, drivers will be able to buy electric cars only - ending the near 150-year reign of the internal combustion engine.
From around 2020, town halls will be allowed to levy extra charges on diesel drivers using the UK's 81 most polluted routes if air quality fails to improve.
Diesels might even be banned at peak times. Judges ruled the Government was breaking the law by allowing concentrations of nitrogen dioxide to build up in urban areas.
ClientEarth, an environmental law organisation, argued successfully that ministers were not doing enough to tackle the issue.
A judge ordered ministers to unveil the new air quality strategy to cut illegal levels of pollution from diesel vehicles by next Monday.
The Government also faces fines from the European Commission, which has sent Britain a final warning to comply with EU air pollution limits for NO2 or face a case at the European Court of Justice.
Any suggestion that drivers of diesels should be penalised will be greeted with anger from motoring organisations. They point out that the last Labour government had encouraged people to buy the vehicles.
It was thought that efficient diesel engines were the best way to cut greenhouse gas emissions. It later emerged that the nitrogen dioxide they emit was harming air quality.
Levels have been above legal limits in almost 90 per cent of urban areas in the UK since 2010.
The toxic fumes are estimated to cause 23,500 early deaths a year and the problem was declared a public health emergency by a cross-party committee last year.
New guidance to councils will see them urged to introduce a range of measures to bring down pollution.
These include making buses more environmentally-friendly, changing the phasing of traffic lights, removing speed bumps and changing road layouts. Town halls will be told to do all they can to avoid hitting diesel drivers, who bought the cars in good faith, with punitive measures.
But if these do not work, the Government will allow town halls to charge drivers of the dirtiest vehicles using the most polluted roads.
They could also restrict the times of day when they can use these roads - banning them during peak hours, for example. Town halls will not be allowed to bring in city-wide restrictions. They will only be able to take action on the 81 most polluted roads in the UK.
A Government spokesman 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.
"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.
"Overall we are investing £3 billion to tackle the effects of roadside pollution and supporting greener transport initiatives."
The clean air plan will be unveiled by Mr Gove's Department for Environment, Food and Rural Affairs and Mr Grayling's Department for Transport. The Government said poor air quality was the largest environmental risk to public health.
Evidence from the World Health Organisation shows that older people, children, people with pre-existing lung and heart conditions, and people on lower incomes may be most at risk, a spokesman said.
Mr Gove will tell councils to concentrate its action to reduce emissions on some of the busiest roads and junctions. Analysis of more than 1,800 of Britain's major roads by the government's Joint Air Quality Unit shows that 81 - 4 per cent - are affected, with 33 roads outside London.
In many areas - including Nottingham, Bolton, Bristol, Cardiff and Middlesbrough - a single road is affected. Although ministers have not ruled out charging and restricting access to polluting cars at the busiest times, they want town halls to exhaust all other options first. An extra £255 million will be given to councils to help them bring in the plans, which will have to be drawn up by the end of 2018.
The Government will also invest money in a Clean Air Fund. Councils will be able to bid for money to support improvements that avoid the need for restrictions on polluting vehicles. But ministers accepted that if this did not succeed in reducing emissions, councils may need to consider restrictions on polluting vehicles using affected roads.
It could mean preventing polluting vehicles using some of the roads at certain times of the day - or introducing charging, as London mayor Sadiq Khan has announced.
A source said: "The Government is clear that local authorities should exhaust other options before opting to hit drivers with new charges for using vehicles they bought in good faith.
"Any restrictions or charging on polluting vehicles should be time-limited and lifted as soon as air pollution is within legal limits and the risk of future beaches has passed."
"A consultation will also be launched in the autumn on mitigation measures including a possible scrappage scheme to support drivers affected by any restrictions on polluting vehicles."
Last week a cross-party group of MPs wrote to Mr Gove demanded restricted access for polluting vehicles in urban areas.