The European Commission has sent a "final warning" to the UK for failing to address repeated breaches of legal air pollution limits in 16 areas including London, Birmingham, Leeds, and Glasgow.
The UK is one of five countries served with the warning over persistent breaches of nitrogen dioxide levels, which come from sources including factories and vehicles, particularly diesel engines.
Air pollution is linked to the early deaths of about 40,000 people a year in the UK - and causes problems such as heart and lung diseases and asthma.
The Commission said that if the countries failed to take action on the issue within two months, it may decide to take the matter to the European Court of Justice.
European Commission spokesman Enrico Brivio told a briefing in Brussels: "It is a warning that we send to member states asking to comply, to take measures to fight this poor air quality that provokes respiratory disease and cardiovascular disease.
"It is an important factor on the health of citizens.
"So we ask the UK, as the other four member states, to take appropriate measures to fight this type of air pollution and we hope they comply."
Asked whether the UK would remain bound by any legal proceedings after Brexit, Commission spokesman Alexander Winterstein said: "For as long as the UK is a member of the European Union, rights and obligations apply.
"European law applies fully."
The warning comes as campaigners ranging from health workers to environmentalists ramp up calls for the Government to take action on air pollution, demanding a new Clean Air Act and a crackdown on diesel vehicles.
According to the European Commission, road traffic is responsible for around 40% of emissions of nitrogen oxides in the EU, with the contribution at ground level much higher.
Around four fifths of nitrogen oxides which come from traffic come from diesel-powered vehicles, the Commission said.
Jenny Bates, Friends of the Earth air pollution campaigner, said: "It's shameful that the EU has to take legal action against the UK government to get it to deal with the dangerous levels of dirty air across the country.
"Air pollution is responsible for tens of thousands of early deaths every year and is harming the health of an entire generation of children.
"Current government plans have been shown to be too little too late."
She called for Government funding of clean air zones in pollution hotspots and for a Clean Air Act to protect the public from poor air quality after Brexit, when the UK could no longer rely on EU air quality rules and courts to push for action.