Ex-smokers need to make sure they do not put on too much weight after quitting, researchers advice.
People who give up smoking may put on weight
They found the health benefits of giving up smoking were reduced if too much weight was gained.
The Kings College London team found many people who quit smoking piled on the pounds and this hampered lung health.
They believe dietary advice should be provided by smoking cessation services. Their findings appear in the Lancet.
Dr Susan Chinn and colleagues studied about 6,600 people from 27 European countries.
They looked at the effect of weight and smoking status on lung health, measured by lung function tests, over more than a decade.
These tests measure the volume of air a person hold in their lungs and how much they can expel from their lungs over one second - the higher the numbers, the healthier their lungs are.
There were some expected differences in lung function and weight - current smokers tended to have the biggest decline in lung function over time and people who had given up smoking were more likely to have put on weight.
The increase in weight was greatest in recent quitters and smallest in people who quit but then started smoking again.
Furthermore, ex-smokers who put on weight had poorer lung function than ex-smokers who did not.
They were able to estimate that a man who gave up smoking but gained 1kg in weight per year would get no net improvement in lung function because the two factors cancelled each other out.
For women, the corresponding weight gain that would negate the benefit of quitting smoking is 2.43kg per year, they estimate.
"Our data suggest that weight gain is an important factor in reducing the beneficial effects of quitting on lung function.
"Interventions to reduce this weight gain might be warranted," said Dr Chinn.
Ian Wilmore of Action on Health and Smoking said: "This makes a lot of sense and it is always a good idea to give up smoking under medical supervision."
But he said the fact that some people might put on weight was not a reason not to quit. He said there were many health benefits to be gained by stopping smoking and that any weight gain would not wipe out all of these.
A spokeswoman from QUIT said: "The best advice for smokers is to focus on stopping smoking, as the most important thing, and if necessary to attend to issues of weight gain later."