A novelist who draws inspiration from newspapers and current affairs, in this, his 20th Rebus novel, Ian Rankin has broached one of the most troubling issues in modern Britain.

Even as this book was being written, stories were emerging that cast doubt on the probity not only of a few rogue coppers, the likes of whom fed stories to tabloid hacks or dished out kangaroo justice in the back of their black vans, but officers in higher echelons who took it upon themselves to hide facts or lose evidence that would disgrace the force.

The corruption at the heart of Saints Of The Shadow Bible is not recent. Its repercussions, however, are still being felt - and to an uncomfortable degree when the Solicitor General abolishes the double jeopardy law and instigates an investigation into a case that Rebus and his old team at St Leonard's police station dealt with in the 1980s, in which it looks as if a man guilty of murder was allowed to walk free because of his usefulness as a police informant.

That man is now an Edinburgh taxi driver. Of the team that Rebus was part of, one has had a severe stroke; one is retired from the force; and one, who resigned over the mishandling of that old case - "taking one for the team" - is now a wealthy businessman and a leading light in the No campaign as the independence referendum looms. Rebus, meanwhile, is back with CID in the lowly position of Detective Sergeant, the same rank he had reached when the case now under review happened.

That band of detectives had enjoyed a masonic allegiance, at the centre of which was a book on which they all swore to be faithful to each other above all else. Portentously calling themselves the Saints of the Shadow Bible, they were a law unto themselves, as Rebus belatedly acknowledges. Famed, and feared, they got results by often dubious means. And now, as this old case is brought back to light, it is unclear to Rebus's superiors to what extent he was involved in something worse than merely bending the rules.

There is, naturally, another strand to this novel, which is as complicated and intricate as a circuit board. At the start, a student is hurt in a suspicious car crash. She, it turns out, is the girlfriend of the justice minister's son. When the minister's house is broken into, and he is found unconscious, and later dies, it looks not just suspicious but downright sinister.

Rankin also ratchets up his hero's discomfort by making him work alongside Malcolm Fox, the punctilious, teetotal investigating officer of the Complaints and Conduct Office. Cue many acid one-liners from Rebus, and a grudging sense of sympathy for the insipid Fox.

Arguably Rankin's most ambitious Rebus novel in recent years, attempting as much to fathom the psyche of his long-serving hero as the details of old crimes, Saints Of The Shadow Bible has a melancholic, nostalgic depth to it, as Edinburgh policing of yesteryear is set against today's politically correct culture. Were I ever in the cells, I know which decade I'd rather be in, as no doubt would most readers.

Using all his usual techniques of banter and prosaic descriptions that read like a traffic warden's notebook - "That evening Rebus drove the full length of Arden Street, seeking a parking place, ending up in Marchmont Crescent" - Saints Of The Shadow Bible is executed with the swagger of a pro.

However, it also shows a certain weariness, pet phrases appearing too often - "she nodded her agreement", "he pretended to complain" - and Rankin keeping himself amused as much as the reader, one suspects, in his constant urge to tell us whatever track is playing on the car radio, or in a bar, or on Rebus's turntable. That Malcolm Fox admits he rarely listens to music is as profound an insight into character - call it an indictment - as one will ever get in these novels.

Rankin's easy style and constant unfolding of events means there is no temptation to put this down unfinished, for all that the police procedural has grown frowsy with overuse. Where he stamps his personality on to this genre most engagingly is in his handling of characters, particularly those at the fringes of the tale. From bar bouncers and regretful wives to elderly pathologists and cynical journalists, he creates a city teeming with hidden lives and secret sorrows. In this respect at least, Rebus is reminiscent of Simenon's Maigret, a man ambivalent about conventional definitions of good and bad. Just like an old-style cop, you could say - and too many modern-day ones, too.