Grandma's advice to "feed a cold and starve a fever" might have an element of truth, say scientists.

New research shows that the old adage appears to be based on sound science when a fever is caused by bacterial infection.

Scientists put the folk wisdom to the test using laboratory mice with bacterial and viral infections.

They found that mice with flu - like the common cold, caused by a virus - were helped to recover and survive when they were fed. In contrast, feeding animals infected by bacteria only hastened their death.

Lead researcher Professor Ruslan Medzhitov, from the Yale School of Medicine in the US, said: "We were surprised at how profound the effects of feeding were, both positive and negative.

"Anorexia - not eating - is a common behaviour during sickness that is seen in people and all kinds of animals. Our findings show that it has a strong protective effect with certain infections, but not with others."

In the first of a series of experiments, mice were infected with Listeria bacteria - a common cause of food poisoning.

The animals stopped eating naturally, and eventually recovered. However, when they were made to eat, they died.

Sugary food was the culprit, the researchers discovered - the mice survived when they were fed protein and fats but no glucose.

A similar study of mice infected with the flu virus showed an opposite effect. In this case, the mice lived when they were force-fed glucose, but died when they were denied food.

Giving the animals a drug called 2-DG, which prevents glucose metabolism, saved the Listeria-infected mice but proved fatal to those with flu.

Further research indicated that the different outcomes related to an interplay between metabolism and the immune system.

"Almost everything we know about infection is based on immune response studies and looking at how the immune system eliminates pathogens (harmful agents)," said Prof Medzhitov. "But that's not the only way we defend ourselves. There are also cases where we change and adapt so that microbes don't cause harm.

"Our study manipulated the ability of these mice to tolerate and survive infection without doing anything that had an effect on the pathogens themselves."

His team is now looking at how changes in sleep behaviour during illness influence the way the immune system fights infection.

The researchers also want to investigate why people sometimes display food cravings when they are sick.

The new findings, published in the journal Cell, have implications for the design of clinical trials evaluating the benefits of nutrition to patients with sepsis, say the scientists.

Sepsis is a life-threatening condition caused by a response to infection that damages the body's tissues and organs.

Prof Medzhitov added: "Sepsis is a critical problem in hospital ICUs (Intensive Care Units) that defies most modern medical approaches. A number of studies have looked at nutrition in patients with sepsis, and the results have been mixed. But these studies didn't segregate patients based on whether their sepsis was bacterial or viral.

"The implication is that patients should be stratified by the cause of their sepsis, and trials should be designed based on that."