Dogs are not only man's best friend, but also may be the key to living a longer life, according to a new study.

Our four-legged friends have long been praised for their ability to help mental wellbeing, reducing anxiety and loneliness, but less has been reported about how they might have a positive effect on physical health.

Combining patient data of 3.8 million people from multiple studies, including England, researchers found owning a dog can lead to better cardiovascular outcomes, especially for heart attack and stroke survivors who live alone.

Scientists at the American Heart Association say that compared to those without a pet dog, owners experienced a 24% reduced risk of all-cause mortality and are 65% less likely to die after a heart attack.

Those who had suffered cardiovascular-related issues were also 31% less likely to pass away.

The results support a separate study carried out by Sweden's Uppsala University, which showed a 33% reduced risk of death for heart attack patients living alone after being released from hospital if they owned a dog.

A similar drop was seen among stroke patients once they were discharged, at 27% lower than those without a dog.

"These two studies provide good, quality data indicating dog ownership is associated with reduced cardiac and all-cause mortality," said Glenn N Levine, from the American Heart Association.

"While these non-randomised studies cannot 'prove' that adopting or owning a dog directly leads to reduced mortality, these robust findings are certainly at least suggestive of this."

Professor Tove Fall, from Uppsala University, said keeping a dog can also help because it is a good motivation for physical activity, but warned that further research is needed.

"The results of this study suggest positive effects of dog ownership for patients who have experienced a heart attack or stroke," she said.

"However, more research is needed to confirm a causal relationship and giving recommendations about prescribing dogs for prevention.

"Moreover, from an animal welfare perspective, dogs should only be acquired by people who feel they have the capacity and knowledge to give the pet a good life."

The study was published in the Circulation: Cardiovascular Quality and Outcomes journal.