Mother's milk can increase the chances of a child growing up obese - suggesting that breast is not always best, research has shown.
A study of 25 mother-infant pairs identified sugars in breast milk that heightened a baby's risk of being overweight by the age of six months.
But scientists also found that breastfeeding was something of a lottery. Depending on its make-up, breast milk could either promote obesity or protect against it.
The findings go some way towards explaining conflicting results from studies looking at the effects of breastfeeding.
Previous research has also shown that obese mothers often give birth to overweight children, but the link is not understood.
US expert Professor Michael Goran, from the University of Southern California's Childhood Obesity Research Centre, who co-led the study, said: "Early life experiences related to the environment and different feeding modalities contribute to obesity. But typically we think of obesity risk kicking in after weaning - the timing of introduction to solid foods, early exposures to sugary beverages.
"Clearly there is something going on before weaning even in babies who are exclusively breast-fed."
Sugary complex carbohydrates in breast milk called human milk oligosaccharides (HMOs) were the key factor linked to infant obesity, the scientists found.
HMOs were already known to play an important role in helping develop a baby's immune system.
Two specific HMOs, called LNFPII and DSLNT, were each associated with around one pound of extra fat mass at six months of age.
Increased amounts of another HMO called LNFPI appeared to be protective, being linked to a pound less of fat at six months.
Prof Goran accepted the study, published in The American Journal of Clinical Nutrition, was small and further research was needed.
He said: "Ultimately what we would like to be able to do is identify which of the HMOs are most important for obesity protection and then use that as a supplement that can be given to the breastfeeding infant and added to infant formulae."
Current infant formula preparations do not contain any HMOs, he pointed out.
The researchers analysed the breast milk of participating mothers and carried out measurements of infants at one and six months of age.
HMOs cannot be digested and play a role in shaping the gut "microbiome", the population of bacteria in a baby's intestines. It is this that is thought to influence obesity.
"How the gut microbiome develops will have a long-term influence on obesity and health risk," said Prof Goran. "These compounds that are not being digested go straight into the infant's gut and act as prebiotics. They act as fuel for microbes in the gut and help them grow and become diverse."
What is not yet known is why the composition of breast milk varies between mothers. Besides genetic factors, diet may be important, the scientists believe.
Prof Goran added: "It would be very interesting if dietary sugar or fat consumption were found to be related to HMOs. That is something we hope to explore in future studies."