A family dog may be a baby's best friend for avoiding allergies and becoming obese later in life, a new study suggests.

Research at the University of Alberta shows infants from families with furry pets, especially dogs, showed higher levels of two types of gut microbes associated with lower risks of obesity and allergic disease.

"The abundance of these bacteria were increased twofold when there was a pet in the house," said Anita Kozyrskyj, a pediatric epidemiologist who is one of the world's leading researchers on gut microbes.

The findings of her research team were published Thursday in the journal Microbiome.

The study theory suggests that babies exposed to dirt and bacteria from a pet's fur or paws can create early immunity. The exposure can happen from pet-to-mother-to-unborn baby as well as during the first three months of the infant's life.

"This interaction is required for a baby's immune system to develop," she said.

"The microbes are training the immune system to react to harmful entities like pathogenic microbes and not react to beneficial microbes and food nutrients."

Kozyrskyj said the findings build on the work of earlier research that found that children who grow up with dogs have lower rates of asthma.

Higher levels of one of the microbes are associated with leanness and protect against obesity.

'Dog in a pill'

The research involved 746 infants from the Canadian Healthy Infant Longitudinal Development Study whose mothers were enrolled during pregnancy between 2009 and 2012.

The study also suggests having pets in the house could reduce the chances of a mother passing on a strep infection during birth, which can cause pneumonia in newborns.

Since the study is an observational one, no research conclusions can be made about cause and effect.

The researchers said 70 per cent of the families involved in the study had dogs. Others had cats or other furry pets.

Over half of the study's infants were exposed to at least one furry pet.

Kozyrskyj said perhaps someone in the future will develop a "dog in a pill" to help prevent allergies and obesity.

"It's not far-fetched that the pharmaceutical industry will try to create a supplement of these microbiomes, much like was done with probiotics," she said.

But the researchers also noted other studies on pet exposure and gut microbes in later infancy haven't shown the same associations.

It's also unclear whether the theoretical "dog in a pill" would work in real life.