With a population of more than 23m, Karachi, PAkistan is one of the world’s largest cities. It’s also a hotbed of crime, corruption and militancy.

Omar Hamid was a police officer there for 12 years, before leaving to become a security analyst in the UK. In an event in Washington DC last week for the Project for Study of the 21st Century (PS21), he explained where it all went wrong.

Being a police officer means you really get to see the whole gamut of issues in Karachi. There are issues of sectarian violence; there are issues that any mega-city has. There are issues of political parties with the militias. There are issues of the growing presence of the Pakistani Taliban. And, of course, you have all of the regular crime.

With Karachi the commercial centre of Pakistan, control and influence within it is just too lucrative. In effect, the story of the past 25-30 years of the city is the struggle between various groups to squeeze that pie as much as possible. What you can learn from Karachi’s example is exactly what not to do in any mega-city.

With the expansion of megacities, you have a situation where the central government – and in many cases the local government – has very little control. As these cities grow organically, control over scarce resources often ends up in the hands of non-state groups, political parties or organised crime syndicates. The challenge for urban governance this century will be how the state is able to impose itself, or how it can prevent resources from being taken over.

Karachi has large representations of all the ethnicities and nationalities in Pakistan. All of these various groups feel that they have a vested interest in the city, all of them have competed for that. The complex political environment comes from the fact that, over the past 25 years, Karachi’s ethnicities have been essentially pitted against each other. They form the basis for political parties.

Most of these political parties have also represented themselves through criminal militias. Those militia come to the forefront of organised crime and corruption.

What you can learn is exactly what not to do in any mega-city

As these parties fight for control of the city, the infrastructure of government – whether it’s the municipal operation of the city, or the police force – has become almost hopelessly politicised. Civil servants or police officers go to one party or another to vie for lucrative postings. The objective is to get in the good books of a certain local party, to get a good posting and to be able to recoup your expenses by making that a poster revenue generating tool. 

Everything is for sale in Karachi. The way that it filters down to the micro level, for instance, is illegal land grabbing. Political parties and religious groups, like the Taliban, indulge in illegally occupying or squatting on pieces of land. They carve slices of land up to create new squatter colonies, then they subsequently sell it off.

There is a shortage of water in the city, so control of the city’s water hydrants is a very key tool in corruption. In 2013 rival elements of the Pakistani Taliban fought over control of water supplies in parts of the city. At one point last year, as the Pakistani Taliban was splintering into various groups, two of them were fighting against each other, essentially for control of water. It had nothing to do with religious ideology. It had to do with the cash that could be gained through the water.

For some time now there has been, it seems to people in Pakistan, a kind of understanding that the west was all right with the excesses of political parties as long as they were secular and talking the right talk. The fact is that the presumption ever since 9/11 has been that it was important to back groups that were opposed to religious extremists. On paper that makes a lot of sense – but the problem in Karachi is that lots of those groups are equally involved in criminal activities. 

It runs part of the city as virtually a parallel state with an extensive armed wing

The MQM, the largest party in the city, is an extremely secular party, totally opposed to the spread of religious extremism. Yet the MQM operates the largest criminal-political Mafia nexus in the city. It runs part of the city as virtually a parallel state with an extensive armed wing that has regularly taken part in politically targeted killings murders of police officers and government officials.

Something that has really turned around over the last five or six years is the growth of civil society. When you’re sitting in Pakistan it feels like civil society does not necessarily have a direction. It’s putting its head everywhere. But the fact it has found its voice is very important. The other thing that’s aided the growth is the expansion of the media in Pakistan. The media too, at times, seems like it’s a lot of heads shouting at each other nonsensically – but it has meant that, unlike in the past, the media is no longer a creature that can be controlled by any particular political party, or the country’s political or military establishment.

Pakistan remains a very violent place, and in Karachi there have been a number of cases of journalists being murdered by all parties. But if there is hope, it is in this: these things are no longer controllable. The crimes or misdeeds of various groups become very public, and the growth of civil society, the growth of social media, means that the contrarian view gets out more often.

Omar Hamid is head of Asia Pacific Risk at IHS, and the author of a novel, “The Prisoner“. 

He is also a global fellow at PS21, the Project for the Study of the 21st Century.