Babies fed home-cooked food are more likely to eat fruit and vegetables when they are older than those given meals from jars and packets, researchers say.
Infants weaned on homemade casseroles and puddings develop a taste for what is good for them by the age of seven.
Experts from from De Montfort University in Leicester, and the universities of Bristol and Birmingham, analysed data from 7866 mothers of children born in 1991 and 1992.
The results showed that youngsters who were frequently given home-cooked fruit or vegetables aged six months were more likely to be eating higher amounts of fruit and vegetables at the age of seven than those given home-cooked meals less often.
There was no positive effect on later eating habits for babies fed shop-bought meals.
High levels of fruit and vegetable feeding should be recommended early in the weaning process to optimise the effects of exposure.
Writing in the journal Public Health Nutrition, the researchers said: "The findings support the concept that exposure to fruit and vegetables is important in the early weaning period."
Dr Helen Coulthard, from De Montfort University, said mothers should be giving their infants a home-cooked fruit or vegetable every day.
She said: "The range and type of foods that young children eat is becoming an increasing cause for concern.
"In particular, children do not seem to be eating the amounts of fruit and vegetables recommended for health.
"In 1998 the average intake of fruit and vegetables in young children in the UK was two and a half portions a day.
"There have been, and continue to be, many initiatives to increase this figure to the recommended five portions a day.
"It is interesting that feeding babies ready-prepared fruit and vegetables at six months had no positive effect on later fruit and vegetable consumption.
"This may be due to the fact that infants are fed types of vegetables in ready-prepared foods that the family do not usually eat.
"It may also be that mothers who use ready-prepared foods do not eat as much fruit and vegetables themselves or are more likely to rely on convenience foods.
"In addition fruit and vegetables from packets, jars and tins are likely to have a uniform taste and texture, whereas those cooked at home or eaten raw will vary according to the variety of the particular fruit or vegetable, whether it is in season and the cooking method.
"These variations in the taste and texture of fruit and vegetables should expose an infant's palate to a wider range of experience, increasing the likelihood they will accept a wider range of foods."
The study found that babies weaned earlier, between four and six months, and exposed to fruit and vegetables regularly, had the highest level of consumption aged seven.
Those weaned when they were aged around six months old, and given fruit and vegetables less frequently, were less likely to eat fruit and veg aged seven.
However, those babies given home-cooked fruit and vegetables at a later age but given them more frequently, had similar levels of consumption as those given them earlier.
Dr Coulthard said the early weaning period is an important time for the introduction of fruit and vegetables.
"It is likely that mothers who place importance on providing their child with a diet that is high in fruit and vegetables will start this process during the early weaning period.
"Health workers should encourage the introduction of home-cooked fruit and vegetables rather than ready-prepared baby foods to infants during the weaning process.
"High levels of fruit and vegetable feeding should be recommended early in the weaning process to optimise the effects of exposure."