Their analysis of 319 children showed they were at higher risk of asthma if four types of bacteria were missing.

Experts said the "right bugs at the right time" could be the best way of preventing allergies and asthma.

In the body, bacteria, fungi and viruses outnumber human cells 10 to one, and this "microbiome" is thought to have a huge impact on health.

The team, at the University of British Columbia and the Children's Hospital in Vancouver, compared the microbiome at three months and at one year with asthma risk at the age of three.

Children lacking four types of bacteria - Faecalibacterium, Lachnospira, Veillonella, and Rothia (Flvr) - at three months were at high risk of developing asthma at the age of three, based on wheeze and skin allergy tests.

The same effect was not noticed in the microbiome of one-year-olds, suggesting that the first few months of life are crucial.

Further experiments showed that giving the bacterial cocktail to previously germ-free mice reduced inflammation in the airways of their pups.

One of the researchers, Dr Stuart Turvey, said: "Our longer-term vision would be that children in early life could be supplemented with Flvr to look to prevent the ultimate development of asthma

"I want to emphasise that we are not ready for that yet, we know very little about these bacteria, [but] our ultimate vision of the future would be to prevent this disease."

Image copyrightThinkstock

Asthma is caused by airways that are more sensitive to irritation and inflammation.

Cases have soared, and one in every 11 children in the UK is now diagnosed with asthma.

One explanation for the rise in asthma and allergies is the "hygiene hypothesis", which suggests that children are no longer exposed to enough microbes to calibrate the immune system to tell the difference between friend and foe.

Giving birth by Caesarean section and not breast-feeding both limit the bacteria that are passed to a newborn. Antibiotics taken by a pregnant woman or newborn child can also change the microbiome.

Dr Brett Finlay, another researcher in the project, said: "[I was] surprised to realise that faecal microbes may be influencing things.

"What data's really starting to show these days is that the immune system gets itself set up in the gut and influences how it works everywhere else in the body."

'Right bugs, right time'

Dr Benjamin Marsland, from the University of Lausanne, in Switzerland, told the BBC: "For a number of years, exposure to microbes has been linked with protection against asthma, a classic example is growing up on a farm and drinking raw milk."

He said previous research was showing a mounting role for diet, microbes and the first year of life being key.

He added: "This new study adds weight to these observations and supports the concept that there are certain developmental windows in early life, where it's really important to get the right signals.

"A common factor in all studies so far has been the microbiota, in fact making sure babies have the right bugs, at the right time, might be the best step towards preventing asthma and allergies."

Dr Samantha Walker, from the charity Asthma UK, said: "Asthma is a complex condition, and this research suggests that the delicate balance of gut bacteria in our bodies affects our immune systems and may have a role to play in why some people go on to develop asthma.

"However, much more research is needed to help understand what these findings mean in terms of providing advice for new parents, developing treatments and ultimately a cure."