BRUSSELS - The European Union's top court ruled on Thursday that Britain had breached the bloc's air pollution limits for years and ordered it to comply with the rules, raising the possibility that the country may be fined even though it has quit the EU.

Britain voted to leave the EU in 2016 and finally exited the bloc - including the orbit of the European Court of Justice - at the end of last year.

However, in its withdrawal agreement with the EU, Britain agreed to apply the EU court's judgements in any cases that were initiated while the country was still an EU member.

In its first ruling against Britain since Brexit took place, the court on Thursday ruled that it had "systematically and persistently" breached EU limits for nitrogen dioxide (NO2) in 16 areas, including London, Manchester, the urban area of Teesside in northeast England, and the Scottish city of Glasgow, from 2010 to 2017.

London also breached the hourly limits for NO2, and Britain failed to take measures to keep breaches of pollution limits as short as possible, the court said.

It ordered Britain to reduce NO2 pollution to below the EU limit. Failure to do so could see the Commission take further legal action with the impostion of financial penalties.

The British environment ministry was not immediately available for comment.

Road transport is the main source of NO2 emissions, meaning urban areas tend to be hit hardest.

Prolonged exposure to air pollution can cause diabetes, lung disease and cancer. An inquest last year found that air pollution contributed to the death in 2013 of London schoolgirl Ella Kissi-Debrah, who suffered from severe asthma.

In a bid to curb pollution and meet climate goals, Britain has pledged to ban the sale of new petrol and diesel cars and vans from 2030.

London will also expand its ultra low-emission zone this year, requiring vehicles to meet strict standards or face daily fees.

(Reporting by Kate Abnett Editing by John Chalmers and Gareth Jones) ((Kate.Abnett@thomsonreuters.com;))