Over a couple of decades, people in the research project tended to put on weight, but some did so more than others.
The diets of 136,432 people were investigated for 24 years alongside questionnaire data.
Participants in the study were 65 or younger between 1985 to 2014, when the research took place.
At the beginning of the research project, and up to every four years thereafter, participants shared their medical history, personal characteristics, and lifestyle.
On average, people gained 3.3lbs (1.5kg) every four years, amounting to around 1.5 stone during the next two decades.
They found that those who ate potatoes, peas and sweetcorn were more likely to put on more weight than those who ate broccoli, carrots and spinach.
People who ate non-starchy vegetables, such as broccoli, carrots and spinach, tended to put on 6.6lbs less than those who ate starchy vegetables.
Those tucking into potatoes and sweetcorn could expect to gain 5.7lbs more over the same time period.
These associations were stronger among participants who have excessive body weight compared to those who had a healthier weight.
Most of these vegetable and weight associations were also stronger among women.
Moreover, increases in glycaemic load – the effect on blood sugar levels – were strongly linked to weight gain.
Switching to high-fibre foods, such as wholegrain and fruits such as apples, could reduce the effect of the middle-ages spread.
The authors noted it is an observational study, so it cannot say that eating certain vegetables causes weight gain.
There are limitations to the research, such as relying on the accuracy of the information provided by participants throughout the research period.
However, the findings do “highlight the potential importance of carbohydrate quality and source for long-term weight management”.
This seems to be especially true for people who carry excess weight in the first place.
The findings were published in the British Medical Journal (BMJ).