Welsh Government has failed people and not implemented EU law on air quality, a judge has ruled.
Now it must come up with a clean air plan by May and implement it through councils before August.
This is likely to lead to rapid introduction of vehicle restrictions on some roads where measured pollution is above safe limits.
Parts of South Wales are known to be above limits and the court order could mean low emission zones being introduced in major urban areas, broadly similar to schemes in London and other British cities, with charges being levied on the dirtiest vehicles.
Environmental group ClientEarth took the Welsh Government to court and has won its action and will be repaid its costs as part of the judgement.