KARACHI -- The Pakistani port city of Karachi used to be an easy place to love. Just over a half century ago, it was considered more cosmopolitan and wealthier than Mumbai, India's thriving business capital about 900 km to the south.
Its skyline was dominated by graceful minarets, while down below a circular railway offered mass transit. Residents had a choice of edgy theatrical performances or more traditional music and poetry recitals, reflecting the culture associated with the great Mughal court.
More recently, however, this city of as many as 25 million people has become known as one of the most violent places on earth, plagued by bombings, kidnappings and homicides.
The scourge of crime led novelist Omar Shahid Hamid to write that Karachi had "spread like a cancer, random and menacing. Every day, the paper would be filled with horror stories of people getting killed in the streets, policemen getting shot by gangsters, women mugged at gunpoint in their own homes.... You hadn't had the authentic Karachi experience if your car hadn't been snatched at gunpoint."
This description of Karachi was taken from Hamid's second novel, "The Spinner's Tale," published in 2015. And while it is a work of fiction, it reflects the intimate knowledge of a man who has spent most of his adult life working in the anti-terrorism unit of the Karachi police department, where he is senior superintendent of police.
Hamid's novels are populated with thinly-disguised real-life politicians and gangsters, giving them authenticity that has made them popular in his country. In his pages, as in real life, the "city of light" has gone dark, and nobody who has a choice ventures outside for more than a few steps, even in daylight.
Yet after a grisly period marked by terror attacks and rampant killings -- there were 2,037 homicides in 2013 alone -- Karachi is trying to reclaim its soul from what Hamid calls 'Kalashnikov culture.'
For Hamid and many business and civic leaders, the battle for Karachi is also a fight for the survival of Pakistan. If the city can purge itself of the scourges of violence, terrorism and poverty, they say, Pakistan as a nation could step back from the precipice and become a force for stability of the region.
"You can't make progress in Pakistan unless you make progress in Karachi," says a senior executive at one of the local banks.
Failure would leave a dangerous vacuum in a nuclear-armed country, one that has long been accused of selling weapons technology and of fomenting terrorism across its borders. The resulting contagion could lead to even more turbulence across the border in Afghanistan -- and perhaps more problems for China with its own restive Muslim population in Xinjiang.
Security may be the biggest challenge in Pakistan for the new government of Imran Khan, elected as prime minister in July -- but it is hardly the only one. The lack of a steady supply of electricity is such an issue that many companies are considering moving to Bangladesh.
Export receipts have gone down in recent years while imports have gone up, leaving the country with dangerously low levels of reserves with which to repay its debt. And, worryingly, Pakistan has become collateral damage in the sparring between China and the U.S., with even a contemplated bailout package from the IMF hostage to it.
"The terrorism and the politics have always been hard to separate," Hamid says, sitting in the office of Zubair Habib, the head of the Citizens Police Liaison Committee. The author is wearing his uniform of khaki trousers, a beribboned black shirt, boots and a revolver in a holster on his belt, having arrived at the CPLC in a bulletproof SUV with a handful of guards carrying AK-47s.
It is hard to overstate the importance of Karachi to the larger fortunes of Pakistan, whether political or economic. Over half the paltry tax revenues the central government manages to collect come from Karachi. Headquarters of companies and financial institutions are concentrated there, and the city's harbor is home to Pakistan's main port.
Karachi -- a bit like Beirut -- is a city of competing identities based on ethnicity, origin, language and narrow religious ties rather than an overriding sense of loyalty to the city itself. It has always been a city of refugees, whether from India following Partition in 1947, or economic migrants seeking a better life, or, more recently, when it became home for up to 2 million Afghan refugees fleeing the war in their country.
It has also been the principal seat of several political parties, including the People's Party of the Bhutto family, which is still a force even after the killing of Benazir Bhutto in 2007, and of the MQM, associated with the Urdu-speaking Muslim refugees who once made their homes in North Indian cities like Delhi and Lucknow. Many of the gangs that held the city hostage for many years had close connections with the politicians of the city -- as well as the jihadis whose activities shaded into theirs.
The turning point for Karachi was just over five years ago, according to many residents, including members of the police, the government and the business community.
As violence was soaring to record levels, then Prime Minister Nawaz Sharif, whose political base was in the far more prosperous state of Punjab, came to the beleaguered city to meet with senior officials of the provincial government, members of civil society, the police and the army, according to several participants who joined the 60 or so invitees. Many of them, Hamid included, had close relatives who had been killed or kidnapped and held for ransom.
Establishing a road map for fixing Karachi was never very difficult; the challenge was always in the execution.
The first problem was obviously security. In September, 2013, Sharif threw his weight behind Operation Karachi to retake the city from gangs and terrorists. He sent in the Rangers, a quasi-military force, in an acknowledgment that the police force was too demoralized, too incompetent or too corrupt to deal with the problem.
The following year, the reach of law and order was strengthened by widespread revulsion following a terrorist attack on an Army school in Peshawar in which 140 people were killed, mostly children.
"After that, a lot of people got off the fence," Hamid adds. "Everyone concluded that the militancy and sectarianism can't go on."
Since then, there has been a dramatic turnaround. "There is not a single case of kidnapping on my desk today," says Habib of the CPLC. "My phone does not ring constantly. Today, everyone is on the same page."
In all, Operation Karachi, which continues to this day, resulted in the arrest of an estimated 145,000 people and the deaths of 1,450 terrorists and gang members.
This has had a major impact on crime statistics. There were about a dozen cases of kidnapping for ransom in Karachi as of October last year, down from 173 in 2013. Other serious crimes like homicide and extortion have dropped equally as dramatically, with murder rates down by 86% from their peak of over 2,000 incidents through 2013.
Water shortages, trash pileups
The second problem was, literally, the darkness. Flying over the Karachi night, it is hard to believe that it is one of the largest cities on the planet. Many Karachiites say the lack of power had become almost as big a problem as security.
Like everything else in the city, power was hostage to the machinations of politicians and the gangsters: local gangs took payments, especially from localities where the police dared not tread, in return for illegal electricity connections, says Tayyab Tareen, chairman of Karachi Electric. As law and order has been restored, electricity supply has become more regular, if relatively expensive.
Improved safety and a reliable power supply provide a basic foundation for a better future for Karachi, but this is far from enough. Karachi, like the country as a whole, is still moving backward economically. Members of the Pakistan Business Council say business is becoming more difficult for the country's manufacturers -- especially when it comes to textiles, which account for 60% of total exports.
Mohammed Zaki Bashir, the chief executive of Gul Ahmed Textile Mills, notes that only a few of his customers are brave enough to come to Karachi. Despite the improvement in security, many countries still have travel advisories in place warning citizens of the risk of visiting Pakistan.
"I have to go to Bangladesh and to Sri Lanka just to meet with clients," he says. Given these concerns, he has had to open a small factory and a warehouse in the U.K. just to reassure potential customers such as Marks & Spencer that he is a reliable supplier.
Karachi remains unable to provide even basic services. The city generates about 12,000 tons of solid waste a day, but is incapable of treating and disposing of it properly, according to a paper submitted to local research platform Geist Science last year. Garbage collection has been primarily outsourced to Chinese companies.
The city is surrounded by illegal dumps filled with trash that is not treated or disposed of properly. Methane gas leaks into the air; fires spontaneously combust. People living near these toxic sites are exposed to carcinogens.
Only 20 years ago, the land outside Karachi was fertile, in large part thanks to ample supplies of water. But today the combination of climate change and the pressure of demographics -- it is considered one of the world's fastest-growing cities -- means wells have to be dug at ever greater depths as the water table drops. Fruit trees wither and die. Traditional crops such as sugar or rice, which are water-intensive, no longer make much economic sense.
The water shortages are a nationwide problem. Pakistan has the lowest water storage in the world, at 30 days, according to the Ministry of Water Resources. But it is especially acute in the environs of Karachi. Water -- and the scarcity thereof -- has long been linked to instability, from Africa to the Middle East and Central Asia, and is likely to only get worse.
Nevertheless, there are hopeful signs. One of them is down a dusty highway on the outskirts of Karachi at the National Incubation Center, where young graduates are applying cutting-edge technology to some of their country's most daunting problems.
Muhammad Khurram has established a young company called Aqua Agro, which is developing "smart irrigation" technology for Pakistan's farmers, who still commonly use flooding to water their crops. Khurram estimates that farmers who use his smart Internet of Things devices need 50% less water, all the while increasing yields of crops such as lemons by 30%. He is using crowdfunding to raise money to reduce the cost of the devices, which currently cost farmers 15,000 rupees ($108).
His colleague, Fatima Anusha, has devised a technique to treat organic waste and turn it into fertilizer, a method that improves yields without the harmful chemicals that ultimately denude the soil.
Such startups may offer more hope than many government programs, given the chronic mismanagement and corruption that continues to plague the country.
"Still plenty of demons"
Across Karachi, there are small signs that normal life is returning. Until recently, the city only had a few cinemas -- in part because of the pervasive security issues. But it also reflected the influence of an intolerant strain of Islam that was attempting to turn Karachi into Riyadh. Today, though, new cinemas are opening, some housed in new shopping malls that are sprouting up. Many movies are starting to be shot in Karachi, too, rather than in rival Lahore.
"Fifteen years ago, there were no theaters here," says Ahmed Shah of the Arts Council of Pakistan Karachi. "When I wanted to sponsor a dance festival, I was told it was un-Islamic. When I wanted to have a play performed about burqas, I had to go around the theater personally with a metal detector. Now that has all changed."
Karachi residents want to believe that the worst of the sectarian violence is past, and that the country's 10 years of narrow Islamic governance between 1978 and 1988 under army general Zia-ul-Haq cannot recur.
Yet the poverty, the lack of opportunity for the young, and the fact that many students study at madrassa -- schools linked to mosques, where they are often taught a toxic version of their religion -- means the appeal of extremism can't be dismissed.
As the most important city in the country, fixing Karachi would make a huge difference nationally. But the sense of fragility remains. The paramilitary Rangers are still stationed in the city, camped out in sports grounds in the formerly "no-go" areas such as Lyari.
"It is still too early to take the Rangers out," concedes Habib of the CPLC. "There are still demons to be taken care of."