Having a dog can bring a lot of love into your life. It could also make it last a little longer.

A group of academics from Uppsala University in Sweden analyzed the health records of 3.4 million people in that northern European country, where databases contain detailed information on most everyone’s hospitalizations, medical history and even whether they own a dog. Such detailed records made it relatively easy to suss out the impact of having a canine companion.

The results were heartwarming.

People in possession of a pooch were less likely to have cardiovascular disease or die from any cause during the 12 years covered by the study, according to the study published in Scientific Reports. The impact was greatest for single people, said Mwenya Mubanga, an author of the paper from the university’s Department of Medical Sciences and the Science for Life Laboratory.

“Dog ownership was especially prominent as a protective factor in persons living alone, which is a group reported previously to be at higher risk of cardiovascular disease and death,” Mubanga said. “Perhaps a dog may stand in as an important family member in the single households.”

The researchers examined seven national databases in Sweden, including two that track dog ownership, and focused on people aged 40 to 80. Single dog-owning adults who lived alone were 11 percent less likely to subsequently develop heart disease and 33 percent less likely to die than non-dog owners, the analysis found. Hunting dogs seemed to offer the most protection when it came to staying alive.

It’s not clear exactly how the dogs helped avert heart disease, or whether getting one directly led to better health, cautioned Tove Fall, the senior author of the paper and associate professor in epidemiology at Uppsala University. It’s possible that dog owners are healthier and more active before they get a canine companion, she said.

“We know that dog owners in general have a higher level of physical activity, which could be one explanation to the observed results,” Fall said. “Other explanations include an increased well-being and social contacts or effects of the dog on the bacterial microbiome in the owner.”

Either way, maybe an extra treat for that doting Lab waiting at home is in order.