The creator of the John Rebus thrillers said he had the “absolute minimum” involvement with serving detectives to ensure his books not become “PR exercises.”
Speaking at a launch event for the 24th novel in the Rebus series, A Heart Full of Headstones, Rankin declared: “I’m not in bed with the police.”
The author also said he believed that there was a strong public appetite for crime stories about “the bad boy cops and the mavericks.”
Rankin’s new novel, which is inspired by a spate of recent police scandals in the UK, sees the spotlight fall on allegations of corrupt behaviour at a fictional police station, with Rebus himself implicated.
Speaking at the National Library of Scotland, Rankin said: “I think we thought that the police had cleaned up their act to a certain extent and it wasn’t the way it was in the seventies when you had The Sweeney and suspects were being beaten up in the interview room.
"Rebus has done some pretty bad things in his time, but would always see himself as an angel with a dirty face – he might have got dirty in the process, but he was doing it to get the right result. I just thought: ‘That’s your defence, but is that a real defence?’
"It gets complicated, because it seems to me that the public sometimes want the bad boy cops and they want the mavericks.
“When that show Life on Mars was on, it was about a modern-day, touchy-feely liberal cop going back in time to the seventies and basically ends up in The Sweeney. I think we were supposed to side with him against Gene Hunt and all these boorish, thuggish neanderthal cops. But everybody loved Gene Hunt. People went for him because they like a bad boy and a maverick.
"I have quite a lot of bad cops in this new book. Rebus is implicated all along the way. But I do try for nuance.
“There is one scene, which I’m really proud of, with a bad cop who is trying to arrest a guy who is off his head and has been assaulting people around Haymarket.
“He takes the guy down, but all the members public just stand around getting it on their phones. Nobody is helping him at all. I just thought: ‘That’s the job you do. You’re the thin blue line. Although you are a bad cop, sometimes you’re doing the right thing.”
Asked about any “feedback” he had had over his depictions of police corruption, Rankin said: “An ex-cop who has read the new book sent me a text and said: ‘Oh aye, who told you that story. I know which police station you’re talking about.’
"This stuff has gone on. Retired cops are fairly open to telling stories, serving detectives not so much.
“I’m not in bed with the police. Some crime writers do try to get very close to the police, but I do the absolute minimum that I need. I don't want the books to become PR exercises. I want to feel able to write about bent cops and bad cops.”
Rankin admitted many fans did not like Malcolm Fox, a serving officer who has investigated some of Rebus’s past misdemeanours.
Rankin said: “He’s like the anti-Rebus. But I think you need someone who is trying to bring your main character down, sometimes with good reason. He knows what Rebus did and what he got away with in the days before all this stuff was captured on film and camera phones.”
Rankin’s latest book sees Rebus once again locking horns with long-time nemesis “Big Ger” Cafferty, as the retired detective and the wheelchair-bound former gangland figure both battle ill-health.
Rankin said: "Rebus has now been retired for quite a long time. He doesn’t know the people on the front desk of a police station anymore. He doesn’t automatically get through the front door.
"I think the retirement books have been some of my favourite books.
"Rebus is getting older, Cafferty is getting older. They’re getting creakier, they ache in the places where they used to play. That’s a really interesting process. Both men are asking themselves: ‘Do I still matter? Do I still make a difference? Do I still have a role to play?’
"The violence (in the books) is minimal these days, partly because Rebus is no longer a cop so isn’t dealing with violent situations per se. Rebus and Cafferty are both past the point at which they can physically intimidate. It’s part of that powerplay between them, like they’re sitting over a chessboard, whereas once upon a time they’ be in a boxing ring.”
Rankin was asked about the increased prominence of female officers in the new book, who feature along with long-time character Siobhan Clarke.
He said: “If you go back to my early books, I wasn’t confident about writing from a woman’s point of view. There were not many women in those books.
"I introduced Siobhan because I decided Rebus did need a sidekick. Women police officers and crime writers said to me: ‘I like her, she’s a good character.’ So I got a bit more confident.
"But in the police there has also been an upsurge in the number of senior positions being filled by women. There used to be a huge glass ceiling. There wasn’t a female chief constable in Scotland until the 2000s.
“For a few years now, I’ve really wanted to do a stand-alone Siobhan book. How it works is I get a theme I want to write about, a plot that allows me to investigate that and the characters that are best suited to tell that story. I’ve just never found a plot or a theme where Siobhan was the answer. I’ve love to.”