Children who are exposed to dogs or farm animals during their first year of life may have a reduced risk for asthma at the age of six, according to a study published Monday by the US journal JAMA Pediatrics.

The findings are in accordance with the so-called hygiene hypothesis, which suggests that too clean environments promote allergies, including asthma.

“Earlier studies have shown that growing up on a farm reduces a child’s risk of asthma by about half,” lead author Tove Fall of the Uppsala University in Sweden, said in a statement.

“We wanted to see if this relationship also was true also for children growing up with dogs in their homes.”

In the new study, Fall and colleagues looked at data from all of the more than 1 million children born from 2001 through 2010 in Sweden, where dog owners have been required by law to register their pet since 2001.

The analyses included nearly 660,000 preschool-age or school-age children who are exposed to dogs or farm animals.

They found that dog exposure during the first year of life was associated with a 13 percent decreased risk of asthma in six-year-old children, while farm animal exposure cut the risk by 52 percent.

The researchers noted that their results were independent of parental asthma or whether the child was first-born.

“For what we believe to be the first time in a nationwide setting, we provide evidence of a reduced risk of childhood asthma in six-year-old children exposed to dogs and farm animals,” they wrote.

“This information might be helpful in decision making for families and physicians on the appropriateness and timing of early animal exposure.”

While the study indicated that children who grow up with dogs or farm animals have reduced risks of asthma later in life, the researchers also cautioned that children with established allergy to cats or dogs should avoid them.