View of London from Primrose Hill during an episode of high pollution. The government has lost a case on its failure to act on pollution.
Photograph: Michael Bowles/Rex

The supreme court has ordered the government to make plans for tackling the UK’s air pollution problem, which has been in breach of EU limits for years and is linked to thousands of premature deaths each year.

London and several other British cities have failed to meet EU standards on nitrogen dioxide (NO2) levels since 2010, running the risk of fines from Brussels and prompting a legal challenge by NGO ClientEarth.

On Wednesday, five judges unanimously ruled in the group’s favour and said the next environment secretary must draw up a plan to meet the EU rules by the end of 2015.

The NGO’s lawyer, Alan Andrews, said: “Air pollution kills tens of thousands of people in this country every year. We brought our case because we have a right to breathe clean air and today the supreme court has upheld that right.”

The legal battle revolved around whether the UK had fulfilled its obligations under the EU air quality directive which came into force in 2010. The outcome of today’s case could force the government to take bolder action on anti-pollution measures such as congestion charging zones.

Around 29,000 people die prematurely each year in the UK because of air pollution, according to Public Health England, and that figure is expected to be revised upwards later this year to take into account the health impacts of NO2.

The pollutant is a byproduct of diesel vehicles, and can cause breathing difficulties in vulnerable people, such as asthmatics and older adults, and can stunt the proper growth of lung function in children. Diesel car sales overtook petrol ones in 2010 and now account for a third of the UK fleet, partly becuase of favourable taxation.

Mayor of London Boris Johnson last year called for a diesel scrappage scheme to tackle air pollution after researchers said Oxford Street had the highest NO2 concentrations in the world, a call echoed by the City of London Corporation in response to the supreme court’s ruling.

Health and environment campaigners welcomed the court’s verdict.

Mike Hobday, director of policy at the British Heart Foundation, said: “Today’s ruling sends a clear message to the government: they must put plans in place to clean up the UK’s dirty air. The government has a duty to protect public health and ensure the air we breathe is safe - a duty they have so far failed to fulfil.”

“The public want our politicians to talk more about environmental issues during this election campaign,” said Doug Parr, chief scientist at Greenpeace. “The judgement today shows why – systematic failure on air pollution means we need better plans to stop fuel burning in city centres from impacting our health and well-being.”

A Defra spokeswoman said: “Air quality has improved significantly in recent years and as this judgement recognises, work is already underway on revised plans to meet EU targets on NO2 as soon as possible. It has always been the government’s position to submit these plans before the end of this year. Meeting NO2 limits is a common challenge across Europe with 17 member states exceeding limits.”

Maria Eagle, shadow environment secretary, said: “This supreme court ruling is a damning indictment of the Tory-led government’s total failure to tackle the UK’s air pollution which is causing tens of thousands of early deaths each year.

“Labour will deliver a national framework for low emission zones to enable local authorities to encourage cleaner, greener, less polluting vehicles to tackle this silent killer.”

On Tuesday, a study by the World Health Organisation put the financial cost of air pollution in Europe stands at more than $1.6tn (£1.5tn) a year. The WHO report was the first attempt to quantify the cost in economic terms.