Children are at risk of dangerous levels of air pollution in cars because exposure to toxic air is often far higher inside than outside vehicles, a former government chief scientific adviser has warned.

Prof Sir David King, writing for the Guardian, says walking or cycling to school would be much better for children’s health. The warning comes as the UK government faces a third legal defeat for failing to tackle the country’s illegal levels of air pollution. Air pollution is known to damage children’s developing lungs but recent research also indicates it harms children’s ability to learn at school and may damage their DNA.

“Children sitting in the backseat of vehicles are likely to be exposed to dangerous levels [of air pollution],” said King. “You may be driving a cleaner vehicle but your children are sitting in a box collecting toxic gases from all the vehicles around you.”

He said new legislation to ban smoking in cars with children had gained widespread support. “So why are we still happy for our children to breathe in toxic emissions in the back of our cars?”

“The best thing for all our health is to leave our cars behind,” said King, who now advises the British Lung Foundation. “It’s been shown that the health benefits of walking and cycling far outweigh the costs of breathing in pollution. If more drivers knew the damage they could be doing to their children, I think they’d think twice about getting in the car.”

A range of experiments, some as far back as 2001, have shown that drivers inside vehicles are exposed to far higher levels of air pollution than those walking or cycling along the same urban routes.

Prof Stephen Holgate, an asthma expert at Southampton University and chair of the Royal College of Physicians working party on air pollution, said there was enough evidence to tell parents that walking and cycling exposes their children to less air pollution than driving.

“It is nine to 12 times higher inside the car than outside,” he said. “Children are in the back of the car and often the car has the fans on, just sucking the fresh exhaust coming out of the car or lorry in front of them straight into the back of the car.”

Why are we happy for children to breathe in toxic emissions in cars but not secondhand cigarette smoke, says David King. Photograph: Mar Photographics/Alamy

Children are more vulnerable than adults, he said, because air pollution can stunt the growing of their lungs and because it increases the risk of sensitisation which can lead to asthma and other respiratory conditions.

Holgate said walking or cycling are better when possible, to reduce pollution exposure in cars and to increase physical exercise. He said: “There are multiple benefits to be gained. But parents are confused at the moment because they think there is less pollution in cars than outside, which is not the case.”

Ben Barratt, from King’s College London, measured the exposure of people travelling by car, bus, bicycle and walking in London in 2014. “The car driver, by a very long way, was exposed to the highest level of pollution,” he said. “The fumes from the vehicles in front and behind were coming into the car and getting trapped there. It is not true that you can escape pollution by sitting inside a vehicle.”

Recent research has added to the concern about the impact of air pollution on children, beyond the direct harm to their lungs. A study in Barcelona showed that air pollution reduces the ability of children to concentrate and slows their reaction times. “This adds to the evidence that air pollution may have potential harmful effects on neurodevelopment,” the scientists wrote.

A smaller study, in California, showed higher levels of traffic-related air pollution correlated with increased DNA damage in children.” Children may be especially vulnerable to the effects of telomeric DNA damage due to their physical development as well as developing immune system,” said the scientists.

Levels of nitrogen dioxide (NO2), emitted mostly by diesel vehicles, have been above legal limits in almost 90% of urban areas in the UK since 2010. The toxic fumes are estimated to cause 23,500 early deaths a year and the problem has been called a public health emergency by a cross-party committee of MPs.

The environmental law firm ClientEarth has defeated the ministers twice in the courts over the adequacy of government air quality plans. Ministers’ latest proposals were published on 5 May but were widely condemned as inadequate, and ClientEarth is now suing the government a third time.

“Air pollution hasn’t been taken seriously,” said Holgate. “There is a very strange situation where the government has to make laws by being taken to court repeatedly. In my view it is really quite appalling that we haven’t started to deal with this properly and put children’s and adults’ health first.”

Diesel drivers have been given tax breaks by successive governments, including when King was chief scientific adviser, to buy diesel cars because they have lower carbon dioxide emissions. Stricter regulations were supposed to limit NO2 emissions from diesels but cheating and the exploitation of loopholes by car manufacturers led to vehicles that emitted far more pollution on the road than in lab tests.

The British Lung Foundation’s Breathe Easy Week takes place on 12-16 June 2017 and a National Clean Air day in the UK takes place on 15 June.