Athletes completing their final pre-Olympics training, and members of the public gathering in London for the final stages of the Olympic torchrelay, have been warned of high levels of pollution in the UK capital on Thursday, ahead of the opening ceremony on Friday night.

The smog warning follows a few days of sunshine, which has intensified the impact of pollutants such as ground level ozone and nitrogen oxides, from traffic fumes.

The Department for Environment, Food and Rural Affairs issued the warning as the level of pollutants reached high levels on Wednesday and Thursday, and were likely to continue for at least 24 hours. Officials reassured the public that most people would be unaffected, but the very old and young, and those who already suffer from breathing difficulties, heart or lung problems or asthma could be at risk. Athletes can be particularly vulnerable, however, as they take in much more air during sport than other people. Some other parts of England and Wales were also warned, but pollution levels are likely to be highest in London.

There had been warnings that the first days of the Olympic games could coincide with hot sunny weather that would worsen pollution.

Simon Birkett, founder and director of the campaign group Clean Air in London, said: "This is the worst 'summer smog' for years. The government must ensure people are warned and advised. It must also publish the full forecast information that is included in daily briefings to the London Organising Committee of the Olympic and Paralympic Games so that athletes and teams can make their own assessment of potential health risks."

He called on Boris Johnson to intervene and "act personally to protect athletes, visitors and Londoners if the government continues to fail to do so."

The Department for the Environment, Food and Rural Affairs (Defra) issued the pollution episode warning at 1650GMT on 25 July, after ozone levels in north Kensington, London, breached the "ozone public information threshold" set by law. The department warned pollution levels would be high for 24 hours as the warm sunny weather is likely to continue. Defra said: "The main pollutant of concern is ground level ozone as a result of the warm and sunny weather which favour the formation of secondary ozone in the atmosphere."

Clean Air in London said this was the first serious warning since new laws on informing the public of high pollution levels came into effect in 2008, and said the UK's worst summer smogs in recent memory occurred in August 2003 and June-July 2006.

"Athletes are thought to be especially vulnerable to the effects of ground level ozone and other air pollutants because they are breathing in very high volumes of air," said Gary Fuller, an air quality expert at King's College London. "It's something that might affect their performance on the day."

Jenny Jones, a Green party London assembly member who ran for London mayor earlier this year, said: "The government and the mayor could have avoided the embarrassment of issuing this warning just ahead of the Olympics if they had taken firm action years ago. Instead we have had a series of delays and backward steps which have done little to improve the health of Londoners. There is now an additional concern that certain events could be affected if the pollution levels become even higher."