His father was assassinated by a notorious Karachi hitman, while his police partner was murdered by the Taliban.
Personal tragedy haunts the hard-boiled novels that are turning top cop Omar Shahid Hamid into one of Pakistan's most popular English-language authors.
For nearly two decades Hamid has worn a badge in Karachi, the mega port city on the Arabian Sea that for years was rife with vicious political and extremist violence.
Now a deputy inspector general, he is also fast becoming one of Pakistan's most recognisable writers, publishing four books in quick succession since 2013.
His work has even nabbed the attention of major streaming outlets on the hunt for new original material from South Asia, including Netflix, which has already seen major success with similar material in TV series such as Sacred Games, about Mumbai's corrupt underworld.
Hamid said the secret to his success is his unflinching accounts of political corruption, contract killers, and crooked cops alongside nuanced portraits of Karachi's divided neighbourhoods.
More From This Section
"Books like mine wouldn't work if I pulled punches," he tells AFP.
"It's that grittiness, that uncompromising reality that I think a lot of readers enjoy." At times the reality has hit dangerously and heartbreakingly close to home.
Hamid did the bulk of his writing while he was on sabbatical after being advised to leave Karachi and take a break from policing in 2011 when he was threatened by jihadist groups.
Weeks after the release of his first novel "The Prisoner", his mentor and police partner Chaudhry Aslam -- the inspiration for one of the book's protagonists -- was killed in a Taliban-claimed suicide blast.
In his third novel "The Party Worker", Hamid portrays the rise of a brutal hitman who killed at the behest of a fictional political party ruling the city with an iron fist.
For Karachi insiders, the character mirrors the life of feared hitman Saulat Mirza, who served as the feared enforcer for the once-powerful Muttahida Qaumi Movement (MQM) party -- and whose list of victims include Hamid's own father, Shahid.
"It's less a thing of making a sketch of Saulat Mirza," explains Hamid, calling the character a "sketch of a particular type of young man... who kind of in the last 30 years or so essentially gave their lives away to these ideologies thinking they were doing the right thing." The goal is not to excuse such actions, he insists.
"Understanding the motivations of someone is a positive tool if you're someone who has worked as an investigator in counterterrorism for a very long time," says Hamid.
"What he has written is fiction but it's very close to reality," says Faheem Siddiqui, Karachi bureau chief for Geo News.
"As a crime reporter, I know what had happened in the city. It took a great deal of courage to write about these events."
"The last 30 years have been a rollercoaster ride," explains Hamid. "If wasn't politico-ethnic violence it was sectarian violence in
"I felt a need to vent about them."