The Raith Rovers fan included the plot line in her 2007 novel Beneath the Bleeding.
She revealed she received a call from Rovers officials, as the club often hosted Gordon Brown, who was prime minister at the time.
McDermid, a team sponsor, said: "In one of my books, Beneath the Bleeding, the first murder is of a Premier League footballer. I have this fictitious city Bradfield and he's the striker for Bradfield Victoria, and he gets murdered.
"Later in the book a bomb goes off in the football stadium. This book was published in the summer that Gordon Brown became Prime Minister, so I get this call from the commercial manager at Raith Rovers. "He's going 'well thank you very, very much. We've had MI5 and the police crawling all over the stadium checking out the security before Gordon comes for a game and you write a book about blowing up a football stadium'."