Breathing in large amounts of traffic fumes can trigger a heart attack up to six hours after exposure, according to research which reaffirms the health risks associated with pollution.

The study, in the British Medical Journal, found that high levels of pollution can increase the risk of suffering a heart attack. It identifies exposure to pollutant particles and nitrogen dioxide expelled by cars, which are both markers of contaminated urban atmospheres, as the main culprits.

The authors quantify the risk as small – up to 1.3% higher risk of a heart attack up to six hours after exposure to those substances. But they say that getting enough of those two substances into the lungs can bring forward by a few hours a heart attack that would have happened anyway. This is called short-term displacement or the "harvesting" effect of pollution.

Krishnan Bhaskaran and six colleagues at the London School of Hygiene and Tropical Medicine examined 79,288 heart attacks that occurred in 15 urban areas of England and Wales in 2003-06, from the Myocardial Ischaemia National Audit Project. They then examined how much pollution occurred in those areas at the time those patients suffered their heart attack, using data from UK National Air Quality Archive.

They studied levels of carbon monoxide, sulphur dioxide and ozone as well as pollutant particles, known as PM 10 , and nitrogen dioxide or NO 2 .

"We estimated that higher ambient levels of the traffic-associated pollutants, PM 10 and NO 2 , were followed by a transiently increased risk of myocardial infarction up to six hours later," the authors write.

The study emerges as the government is facing legal action from the environmental group Client Earth for not protecting the health of people in towns and cities from pollution's damaging effects. Caroline Spelman, the environment secretary, is likely to face a judicial review before Christmas.

Pollution is estimated to cause 29,000 premature deaths a year in the UK, including 4,200 in London alone, said Jenny Bates, an air pollution campaigner at Friends of the Earth.

"This study adds to the urgent need for bold action to cut air pollution in order to comply with EU limits'" she said.

"It's outrageous that we're continuing to breathe this dirty air and that ministers haven't done enough to clean up our air."

Professor Jeremy Pearson, associate medical director of the British Heart Foundation, which co-funded the study, said: "This large-scale study shows conclusively that your risk of having a heart attack goes up temporarily, for around six hours, after breathing in higher levels of vehicle exhaust.

"We know that pollution can have a major effect on your heart health, possibly because it can 'thicken' the blood to make it more likely to clot, putting you at higher risk of a heart attack.

"Our advice to patients remains the same – if you've been diagnosed with heart disease, try to avoid spending long periods outside in areas where there are likely to be high traffic pollution levels, such as on or near busy roads."

A Department for Environment, Food and Rural Affairs spokesman said: "We want to keep improving air quality and reduce the impact it can have on human health and the environment. Our air quality has improved significantly in recent decades and almost all of the UK meets EU air quality limits for all pollutants."

"There are some limited areas where air pollution remains an issue but that's being dealt with by the air quality plans, which set out all the important work being done at national, regional and local levels to make sure we meet EU limits as soon as we can."

• This article was amended on 21 September 2011. The original said that Chris Huhne, energy and climate secretary, is likely to face a judicial review before Christmas. This has been corrected.