KARACHI -- There are two Omar Shahid Hamids.
One is the heroic face of law and order in Karachi, epaulets on his shoulders, a revolver on his waist and bodyguards hovering close by. And there is the cerebral author, clad in kurta, who is as familiar a figure at international literary festivals as he is at briefings as a senior superintendent of police.
Hamid has shot to literary fame in Pakistan with three novels -- most recently "The Party Worker," in 2017 -- all set in Karachi's violent underworld. It is not hard to find shades of the author himself in the characters that populate his stories.
"The Prisoner," Hamid's first novel, is dedicated to his father, a government official who was assassinated when he was 19. Once he became a police officer, Hamid himself turned into a target: he was shot during a raid on the arsenal of one of Karachi's gangs. In 2010, his house was blown up by the Taliban. After he was placed on a mob hit-list and several of his fellow officers were gunned down, he was forced to live abroad for years because the government was unable to guarantee his safety.
Yet he is anything but low-profile. Shortly after meeting a visiting reporter, he stood in front of the press to announce the arrest of gang members who had robbed dozens of homes in the city. It was a typical Karachi story: The gangs helped the household staff get jobs, and they in turn helped the gangs break in to loot their employers' mansions.
Nobody knows the risks of his day job better than Hamid, despite his low-key assertion that he is driven "by a sense of having a personal impact."
For a policeman, the city of Karachi is deadlier even than the country's no-go border regions. Of the 2,111 officers killed in Pakistan since 1971, according to a database compiled by The News International, a local newspaper, 787 were killed in Karachi -- far more than at the country's lawless border with war-torn Afghanistan.
Most of that number -- 545 in all -- were killed following Operation Karachi, which was launched in September 2013 to retake the city from the gangs and terrorists who killed and kidnapped with impunity.
Hamid's father's principal killer was an official with the MQM, the political party associated with refugees who fled India at Partition that was closely tied to Karachi's gangs. Tried and found guilty, the man was executed several years ago, with both Hamid and his mother testifying at the trial.
The toxic nexus between politics, religion and violent crime is something of an obsession for Hamid, who believes that "institutions -- especially government -- are weak. But individuals are strong."
"It is the original sin," he says. "You had these armed wings of political parties, creating a kind of parallel government. Everything was guns, terror and extortion."
Like his father, Hamid has been the object of frequent death threats from militant branches of political parties and jihadis associated with local religious schools and the Taliban. Only months ago, Hamid took part in a raid that resulted in the arrest of an MQM-associated hit man said to have killed 20 people, including two policemen in Karachi.
In other words, Hamid is a man with many enemies. And in a city as corrupt as Karachi, even his law enforcement colleagues may be in the pay of the gangsters.
This is a subject Hamid will not address. But he does say that he believes the improvements in security are sustainable. "I believe it would be difficult for any political party to take things back to where they were," he says.
A sign of this optimism is the fact that his next novel will not be about the dark underside of Karachi. "My next book will be about corruption in sports, especially in cricket," he says.