Researchers at the British Newspaper Archive have unearthed a report about the actor's grandfather Giovanni, who left his Italian village at the turn of the century and ended up in Scotland selling ice-cream.
The story, headlined "Love Tragedy at Glasgow", tells how Giovanni's heart had been "set aflame" by his landlady's daughter Agnes Dougan and he shot himself in the chest after she rejected him.
The report, from the Dundee Courier on January 27, said "Capaldi solemnly informed the mother that if her daughter could live without him, he could not live without the daughter" before turning his gun on himself.
He was taken to hospital with a bullet "lodged underneath the heart" but survived and went on to marry Agnes weeks later.
The couple had five children, including Peter's father Gerard.
Amy Sell, a researcher from the British Newspaper Archive, said: "Local newspaper archives can reveal fascinating information about where we come from. It's shocking to think that if Peter Capaldi's grandfather had not survived, we would be welcoming a different Doctor on to our screens tonight."
Capaldi's first full episode as the Time Lord, Deep Breath, sees him transported to Victorian London, where a dinosaur is running rampant.
The actor said his version of the Doctor will restore the show's sense of "mystery". Speaking on Chris Evans' Radio 2 Breakfast Show on Friday, he said: "It's difficult with a show that's 50 years old but I thought it would be nice to get some mystery back into it."
He said: "It had become very sort of friendly, user-friendly, which is lovely, but I always thought when I grew up Doctor Who was a slightly spooky, weird character who would arrive out of nowhere and take people off deep into space and give them terrible, terrifying adventures and I wanted to evoke a bit of that."