For the third time, the UK government has been slammed by the courts for failing to produce an adequate plan to tackle the growing problem of air pollution, in a landmark judgment that will force ministers back to the drawing board in their efforts to clean up dirty urban air.

The high court ruled that the government’s current policy on air pollution was “unlawful”, and ordered changes. Air pollution has become a leading test case for environmental legal activism in the UK, as scientists have found as many as 40,000 people a year are dying from dirty air across the country.

As a result of Wednesday’s judgment, clean air in the UK will be overseen by the courts, rather than ministers, in a “wholly exceptional” ruling in which the government was roundly defeated.

Anna Heslop, lawyer with ClientEarth, the activist organisation that brought the case and which has pursued the government on the issue for several years, said: “The judge has effectively allowed us to bring this matter straight back to court without delay if the government continues to fall short of its duties. We are extremely grateful for this because it means we will be able to monitor the government’s actions even more effectively and hold them to account.”

Mr Justice Garnham, who heard the case, said: “The history of this litigation shows that good faith, hard work and sincere promises are not enough and it seems court must keep the pressure on to ensure compliance is actually achieved.” He noted a “real risk” from air pollution, said the government’s plans were “seriously flawed” and commended ClientEarth as a “valuable monitor of the government’s efforts”.

He said the approach to tackling pollution in 45 local authority areas was “not sufficient”. The court previously heard that, eight years after the UK was found to be in breach of legal limits on the pollutant, levels were still too high in 37 out of 43 zones across the country.

A spokesperson for the Department of Environment, Food and Rural Affairs, said: “The judge found that our modelling [of air pollution] is compliant [with regulations] and that our approach to areas with major air quality problems is ‘sensible, rational and lawful’. The court has also asked us to go further in areas with less severe air quality problems. We had previously considered that it was sufficient to take a pragmatic, less formal approach to such areas. However, in view of the court’s judgment, we are happy to take a more formal line with them. We have already delivered significant improvements in air quality since 2010 and we will continue to implement our £3.5bn air quality plan.”

This is the third time that activist lawyers have won a legal judgment against the government on the issue, and it will force urgent changes to policy on air quality. As a result of the ruling, if ministers fail to remedy the situation, lawyers have “exceptional” leave to bring a judicial review without seeking further permission.

Effectively, this means the courts will have the powers to pass judgment on whether the government’s actions meet its obligations on air pollution under UK and EU law.

Air quality has been an increasing problem in the UK, with EU-set limits on key pollutants breached frequently over the last decade. But ministers have been slow to get to grips with the problem, which has been caused in part by the rise in the number of diesel vehicles on the roads, and increasing urbanisation.

Measures such as “clean air zones” have been promised in some cities, and welcomed by campaigners, but they are not being implemented widely or swiftly enough to prevent the government’s own commitments on clean air from being breached. Air pollution is thought to cause and contribute to as many as 40,000 deaths a year in the UK already, especially among vulnerable people such as those with existing respiratory problems, but perhaps even worse are the unknown effects on young children, whose lung capacity can be permanently stunted, and their health permanently damaged, by exposure to the pollutants at a young age.

Pollutants include tiny particles, for instance those called PM10 and PM2.5, which can come from diesel exhausts and from the interaction of airborne pollutants, as well as irritant gases such as nitrogen oxides, sulphur dioxide, ozone and ammonia. Wednesday’s court case centred on nitrogen dioxide.

Mary Creagh, the Labour MP who chairs the influential environmental audit committee in the House of Commons, said: “Millions of people in the UK live with illegally high levels of air pollution. Ministers’ shambolic attempts to tackle this means this is the third time the courts have ordered the government to come up with a new plan. The government must now use every tool in the box to clean up our choking cities.”

“Inaction from governments and local authorities simply cannot continue,” said Tompion Platt, head of policy and communications at the pressure group Living Streets. “Making it possible for people to switch to more efficient, healthy and clean forms of transportation is the best way to make the UK’s air breathable for us all.”

ClientEarth won two previous rulings against ministers over the levels, forcing the government to draw up new plans last year for reducing nitrogen dioxide, much of which comes from vehicles, to within legal limits.