He teases Singh with the information that he knew his father, another honest cop (or so the son thinks), and warns him of a dire but unspecified event that will strike Mumbai in 25 days. That sets the clock ticking on the story’s mystery plot, but it’s really a hook to get Singh — and us — to listen to Gaitonde’s story, an epic that combines his own rise as a gangster with a social and political history of India, and a critique of the country’s religious, caste and economic divides.

The novel alternates chapters between Singh’s present-day struggle to decipher Gaitonde’s message and Gaitonde’s narration of his criminal career, and the series does a similar dance, moving with reasonable fluidity between its two modes. The flashbacks play out in a mock-heroic style with tinges of magic realism — a leopard emerging from the forest at an opportune moment, a gang boss punishing his enemies in a particularly crushing manner.

The contemporary scenes, meanwhile, go for low comedy and topical satire, as Singh (the rare Sikh cop on the Mumbai force) dodges his uniformly corrupt superiors. He has the help of an ambitious agent from the intelligence services (Radhika Apte, like Mr. Khan and Mr. Siddiqui an established Indian film star) and his own, much less ambitious sergeant Jitendra Joshi, whose abilities are far outpaced by his appetites. A subplot involving a theatrical agent who doubles as a pimp for victimized Bollywood actresses echoes several real-life Indian prostitution scandals.

Originally developed for television with a pilot by the Hollywood-based Northern Irish writer Kerry Williamson (who’s credited as a co-executive producer), “Sacred Games” comes to the screen as an Indian production, directed by Anurag Kashyap and Vikramaditya Motwane and written by Varun Grover, Vasant Nath and Smita Singh. (It can be watched in its original Hindi, with or without subtitles, or with English, Spanish or Portuguese dubbing.)