There are almost 70 million dogs in the U.S., and a large portion of those pups make it into their family's bedrooms and beds each night.

In the past, some sleep experts have said that letting pets hang out in your bedroom or bed you when you slumber could be deleterious to your health, affecting sleep patterns and preventing a truly restful night.

Researchers at the Mayo Clinic, however, have just come out with a small new study that says canine companions can actually give their owners a sense of security and comfort when they sleep in the bedroom with them. The study, which appeared in Mayo Clinic Proceedings, followed 40 adults and their dogs for five months and included a seven-night period where both the humans and their puppy pals wore activity trackers.

They found that for some people, having dogs in the room was beneficial—up to a point. When dogs were allowed up into the bed, however, their humans' sleep quality suffered.

"Today, many pet owners are away from their pets for much of the day, so they want to maximize their time with them when they are home,” said study author Lois Krahn, M.D., a sleep medicine specialist at the Center for Sleep Medicine at the Mayo Clinic in Arizona. “Having them in the bedroom at night is an easy way to do that. And, now, pet owners can find comfort knowing it won't negatively impact their sleep."