text: Air pollution is blamed for about 2,000 premature deaths in Scotland each year.
  The warning has come from environmental law organisation ClientEarth.
  It has already won a landmark ruling against the UK government at the Supreme Court in London.
  In April last year, the court ruled ministers must draw up plans to deal with air pollution as quickly as possible.
  ClientEarth argues the UK government's plans are inadequate and it has already pledged to take the issue back to court.
  Pollution levels in Glasgow were cited as part of ClientEarth's case.
  It said the city was one of four areas in Scotland identified as having illegal and harmful levels of Nitrogen Dioxide (NO2), which comes mostly from diesel vehicles.
  The group has now warned the Scottish government could also find itself facing legal action over its record on air pollution.
  Environment minister Dr Aileen McLeod said the Scottish government was continuing to make progress in improving our air quality.
  She said: "Data shows that significant reductions in air pollutants have been achieved since 1990 and further decreases are predicted in the future, given our knowledge of the likely impacts of planned investment.
  "Although there has been excellent progress, we recognise that there is more to be done to deliver further benefits for human and environmental health where areas of poorer air quality remain."
  If a case is brought it is understood it would be to the Court of Session in Edinburgh.
  ClientEarth lawyer Alan Andrews told BBC Scotland: "With Glasgow a key city in our case against the UK government, we know that air pollution is causing a huge public health issue in Scotland.
  "In the next few months we will be taking the UK government back to court for its failure to protect people across the country from toxic air pollution.
  "Air quality in Scottish cities is in our sights as much as the rest of the UK and the Scottish government should be aware that it could face legal action should it fail to act."
  Meanwhile, the Scottish government has urged all of the country's local authorities to carry out roadside emissions testing.
  It follows a BBC investigation, which found less than half of the Scotland's councils use powers designed to ensure the most-polluting vehicles are taken off the road.
  Transport minister Derek Mackay, told the Scottish Parliament: "Clearly there is a lot to be done. It's a very challenging area and I think it is right to keep the pressure on it, including our partnership with local authorities.
  "There is already funding within the system to execute many of the actions which have been identified.
  "In terms of roadside testing, 13 out of the 32 local authorities are implementing that. I would encourage others to implement the current regulations as well."
  Glasgow tests about 3,000 vehicles a year but Edinburgh City Council tests none, despite holding the powers to do so.
  It blamed a lack of funding but the Scottish government insisted cash was available to pay for roadside testing.
  Lesley Hinds, City of Edinburgh Council's transport and environment convener, said: "We have made significant use of Scottish government funding to put towards sustainable, long-term projects for improving air quality, including the installation of electric car charging points around the city and support of the ECOStars scheme to reduce fleet energy consumption.
  "While vehicle emissions testing is one way of tackling air pollution, there are a range of alternative, effective methods which we have chosen to focus on.
  "As a council we have chosen to invest in environmental-friendly transport options, such as the millions spent on 'green' hybrid buses for Lothian Buses, a 1% increase in spending on cycle infrastructure year-on-year (9% in the current year), upgrading the council fleet to include electric vehicles and Â£200,000 spent on upgrading the traffic signals at Newbridge roundabout to reduce traffic queuing by 80%."
  Councillor Chas Booth, of the Scottish Green Group, said: "The council seems to be paying lip service to the issue.
  'If Edinburgh doesn't want to use its roadside testing powers it needs to come forward with alternative suggestions to combat the problem, including looking at low emission zones, which we suggested as long ago as 2013.
  "More fundamentally, the city needs to start looking at the causes of air pollution when it is weighing up major planning or development proposals.
  "We need consistency of planning and environmental policy: there is no point going to great lengths to reduce emissions from transport if our planning decisions force more and more people to use the private car."
  BBC Scotland Investigates: Car Sick is broadcast on BBC1 Scotland at 1930 on Wednesday. The programme will also be available later on the iPlayer.
target: The Scottish government is facing the threat of court action if it fails to tackle illegal levels of air pollution in the country's biggest cities, BBC Scotland has learned.