A diet rich in bananas, chickpeas and peanuts improves gut bacteria in malnourished children, helping kick-start their growth, research suggests.
These foods were found to be particularly good at boosting healthy microbes, in a US study of children in Bangladesh.
The growth of bones, brains and bodies is then more likely.
The World Health Organization said about 150 million children under five around the world were malnourished.
As well as being weak and small, many malnourished children end up with incomplete or "immature" communities of bacteria in the gut, compared with healthy children of the same age.
Boosting good bacteria
This is what scientists from Washington University, in St Louis, believed could be the cause of poor growth – but not all foods are equally good at fixing the problem.
Researchers had studied the main types of bacteria present in the healthy guts of Bangladeshi children.
And they had then tested which sets of foods boosted these important bacterial communities in mice and pigs.
Next, in a one-month trial, reported in the journal Science, involving 68 malnourished Bangladeshi children aged 12-18 months, the research team tested out different diets on small groups.
After closely monitoring the children's recovery, one diet stood out – which contained bananas, soy, peanut flour and chickpeas in a paste.
This diet was found to boost gut microbes linked to bone growth, brain development and immune function.
It also used ingredients that were affordable and acceptable to people in Bangladesh.
Prof Jeffrey Gordon, from Washington University, who led the research with colleagues from the International Centre for Diarrhoeal Disease Research in Dhaka, Bangladesh, said the aim had been "to target microbes to heal".
"Microbes don't see bananas or peanuts – they just see a blend of nutrients they can use and share," he said.
"This formulation worked best in animals and humans, producing the greatest repair."
Other diets, dominated by rice or lentils, fared less well and sometimes damaged the gut even more.
Prof Gordon said it wasn't yet completely clear why these foods worked best but a much larger trial was now being carried out to see if the diet had long-term effects on children's weight and height gain.
"This is a community of microbes that extends far beyond the gut," he said.