We examined the association between dog ownership and mortality and whether the association depends on having a spouse in a population-based registry study. All Danish citizens over age 18 years who died in 2015 (N=45 864) were matched to five people who remained alive in 2015 (N=229 320). The total sample were linked to a mandatory nationwide register of dog ownership. Dog ownership was associated with slightly 8% lower all-cause mortality. The association was confined to people without a spouse (OR 0.86; 95% CI 0.82–0.91), while the association was weaker in people with a spouse (OR 0.98; 95% CI 0.93–1.03).