Let sleeping dogs lie … in the bedroom. That's according to a new Mayo Clinic study that's sure to set many tails wagging.

It's no secret that Americans love their dogs. According to the American Veterinary Association, more than 40 million American households have dogs. Of these households, 63 percent consider their canine companions to be family. Still, many draw the line at having their furry family members sleep with them for fear of sacrificing sleep quality.

"Most people assume having pets in the bedroom is a disruption," says Lois Krahn, M.D., a sleep medicine specialist at the Center for Sleep Medicine on Mayo Clinic's Arizona campus and an author of the study. "We found that many people actually find comfort and a sense of security from sleeping with their pets."

The study, "The Effect of Dogs on Human Sleep in the Home Sleep Environment," evaluated the sleep of 40 healthy adults without sleep disorders and their dogs over five months. Participant and their dogs wore activity trackers to track their sleeping habits for seven nights.

According to the study, sleeping with dogs helps some people sleep better ─ no matter if they're snoozing with a small schnauzer or dozing with a Great Dane. There is one caveat, however. Don't let your canines crawl under the covers with you. The sleep benefit extends only to having dogs in your bedroom ─ not in your bed. According to the study, adults who snuggled up to their pups in bed sacrificed quality sleep.

"The relationship between people and their pets has changed over time, which is likely why many people in fact do sleep with their pets in the bedroom," says Dr. Krahn. "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. 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."

So, go ahead. Turn your sheepdog into a sleep dog. Just make sure they are relegated to their own bark-o-lounger, rather than your bed.

The study was published in Mayo Clinic Proceedings.