Owning a dog may be among the best remedies for those who have experienced a heart attack or stroke, according to new research.

Overall, owning a dog is associated with lowering the risk of a second heart attack or stroke by nearly one-third and sees a 24 percent reduced risk of death when compared with those living alone, according to two comprehensive studies published in the American Heart Association’s journal Circulation: Cardiovascular Quality and Outcomes.

The first study looked at more than 300,0000 Swedish residents between the ages of 40 and 85 who had previously experienced a heart attack or ischemic stroke using data published in the Swedish National Patient Register, a comprehensive database of Swedish health. Researchers found the risk of death was 33 percent lower for dog owners living alone and just 15 percent for those with a partner or child when compared against those who did not have a dog in the household. For those who had experienced a stroke, dog owners saw a 27 percent lower risk with a dog and 12 percent lower with a partner.

“We know that social isolation is a strong risk factor for worse health outcomes and premature death. Previous studies have indicated that dog owners experience less social isolation and have more interaction with other people,” said study author Tove Fall in a statement. “Furthermore, keeping a dog is a good motivation for physical activity, which is an important factor in rehabilitation and mental health.”

However, the authors are quick to note that their findings may be positively skewed by dog owners who also live with a partner or negatively associated by people who may have recently lost a dog. They caution that more research is needed to confirm a causal relationship before “prescribing dogs for prevention”.

“The major limitation relates to data that we didn’t have, such as information on lifestyle and personality. The big question is whether people that get a dog are already more interested in physical activity and social interaction. If so, they might have been somewhat protected from anyway, even without the dog,” Fall told IFLScience.

In a second study, scientists reviewed data of more than 3.8 million people aged 18 and older across 10 different studies. They found that dog owners saw a 24 percent reduced risk for deaths as well as a 65 percent reduced risk following a heart attack, and a 31 percent reduced risk to cardiovascular-related issues.

“Our findings suggest that having a dog is associated with longer life. Our analyses did not account for confounders such as better fitness or an overall healthier lifestyle that could be associated with dog ownership. The results, however, were very positive,” said study author Caroline Kramer.

Owning a dog has been associated with increased physical activity, which can decrease depression and loneliness – both of which have been linked to cardiovascular issues.