Researchers analyzed data from four million people in six countries.
They found dog owners had a lowered risk of dying early by 24%.
For those who already had a heart attack, the risk of dying was lowered by 31%.
A major factor could be pet owners who walk their dogs got up to 30 minutes of exercise a day.
Studies also show petting dogs can reduce blood pressure, anxiety and depression.