WHEN crime writer Colin Dexter thought it was time to stop writing about Inspector Morse he didn’t hesitate to kill him off.

Fellow crime novelist Ian Rankin faced a similar decision when Inspector John Rebus was nearing retirement, but instead of taking the rather brutal step of him killing off, the Edinburgh-based detective went out with a whimper rather than a bang.

Rankin knew he wanted to try something different, so in 2009, he turned his attention to a new detective called Malcolm Fox.

A first novel featuring the detective from internal affairs, called The Complaints, was well received by the critics, although some readers inevitably missed Rebus.

Now, Rankin has brought Fox back for a second investigation in a new novel called The Impossible Dead. This time round, the award-winning crime writer has focused on a real-life mystery to provide the inspiration for his engaging story.

In 1985, lawyer Willie McRae, who had possible links to a Scottish nationalist terrorist group, died in mysterious circumstances.

His Volvo 240 was found along a bleak stretch of the A87 in north west Scotland and McRae was found alive but with a bullet in the head and he died the next day.

McRae was thought to have committed suicide but Rankin, prompted by calls from an SNP councillor for the death to be reinvestigated, has used the case as an intriguing plot strand in the latest mystery for Inspector Fox.

In Rankin’s novel, the man who dies is called Francis Vernal but although the name has been changed it is the death of McRae that is being unpacked more than 25 years later.

Are there any dangers in writing crime fiction, I asked Rankin at a hotel in Leeds.

“You have to be careful you don’t upset people who are still around but that hasn’t happened in this instance,” the author told The Guide.

“My Rebus novel Black and Blue looked at the real-life case of the murderer known as Bible John, The Falls was inspired by some tiny coffins I saw from the 1830s and the setting for The Naming of the Dead was Edinburgh’s G8 Summit.

“The beauty of doing this is that the reader doesn’t have to work too hard to suspend his disbelief.”

Whether McRae took his own life or not, Rankin is satisfied that Insp Fox interests him enough as a character to make him the focus of a few more crime thrillers He adds: “When I took the decision for Rebus to retire, my publishers were a bit sweaty about it because they were not sure what I was going to do next but it had to happen.

“The Complaints novel went to number one in the UK and the new book has been getting rave reviews so far. No author wants to think sales are flagging and you keep wanting to write better and better books.

“Good crime fiction has a good sense of place, like Morse’s Oxford, and that’s something I’m still very keen to achieve.

“With this new novel I wanted to explore the idea that terrorism is always with us, and that there will always be disaffected people who think the only way to get their voices heard is to break the law.

“This group supporting Scottish nationalists (the Scottish National Liberation Army) in the 1980s even considered sending anthrax through the post and we’re lucky they didn’t have more success. I sometimes wonder where all these people are today.”

In a piece Rankin wrote for a Sunday newspaper, he concluded: “We may never know what really happened to McRae but his life has provided me with the inspiration for a work of fiction looking at the fears we had back then and the new set of threats we seem to face today.”