This spring, the Rangers, Pakistan’s paramilitary security force, launched a series of raids into Karachi’s slums for what was described by the government as a crime-prevention campaign. Members of the force blocked off the streets surrounding the city’s poorest neighborhoods and exchanged fire with the locals. Over several days, the Rangers seized several caches of weapons and captured or killed dozens of alleged gang members.

As the raids continued, news reports emerged that Uzair Baloch, the former leader of one of the gangs targeted by the military, had accused a number of high-ranking politicians of extortion and conspiracy to commit murder. Karachi is Pakistan’s largest city, with an estimated population of 20 million, and stories of corruption and violence are commonplace there. But Uzair, who is a member of Pakistan’s Baloch ethnic group, was more powerful than your average gang leader, and his accusations were unusually damning.

Uzair had fled the country in 2013. In December, he was arrested in Dubai, and he was held by the authorities in the Emirates while the Pakistani government sought his extradition. Now, according to a report that aired on March 19 on Express News, he had admitted to carrying out assassinations at the behest of powerful figures within the Pakistan Peoples Party, including the country’s former president, Asif Ali Zardari.

The P.P.P. responded that Uzair was a member of a conspiracy against it. On March 18, Saulat Mirza, an assassin who had been on death row for almost seventeen years, had given a sensational televised confession hours before he was due at the gallows. In his speech, Mirza blamed the leadership of the Muttahida Quami Movement, or M.Q.M., Karachi’s most powerful political party, for his crimes. (The execution was delayed, but Mirza was hanged a few weeks later.) There was speculation that Uzair’s confession — which, unlike Mirza’s, had only been reported secondhand — was part of a plot by the military to weaken the P.P.P. and the M.Q.M., Karachi’s two main civilian parties.

That didn’t necessarily mean that Uzair’s claims were untrue, of course. I have been following his career for several years, and the arrest in Dubai was a dramatic reversal of fortune for a man who, during the 2013 general election, had been a key ally of the P.P.P. He had hosted many party leaders, including the chief minister of Sindh province, at his lavish mansion in the slum of Lyari, on the west side of Karachi.

Uzair had been trying to transform himself from a gangster into a legitimate politician. His downfall showed just how provisional legitimacy can be in Karachi, and how deeply embedded gangs are in the city’s politics. His alleged confession suggested he didn’t want to be brought down alone.

On May 11, 2013, the day of the general election, I paid a visit to Uzair in Lyari. Like most Westerners in Karachi, I was staying in Defence, the wealthiest and most secure part of the city, which got its name because its housing developments are operated by a military-owned authority. It occupies a peninsula on the southeastern end of the city, which can be sealed off from the rest of Karachi in times of civil unrest or, on New Year’s Eve, to prevent the city’s poor from mingling with the crowd that watches the fireworks on Clifton Beach.

My taxi drove past high walls that hid manicured gardens and multistory, air-conditioned homes. We were heading north — downtown — toward the bank towers and high-rise offices that lined I. I. Chundrigar Road. To the west, I could see the cranes that served the container ships; Karachi’s ports account for 95 percent of Pakistan’s international trade by volume. The car slowed and we turned onto a narrow, curving road surrounded by stone buildings and shops with their rusted, graffitied shutters pulled down.

For the past two months, election posters had made Karachi’s convoluted political geography legible even to an outsider. I had learned to recognize the major players: the arrow symbol and the green, black, and red banners for the incumbent P.P.P., and the image of a kite in red, white, and green for the M.Q.M.

Much of central Karachi is M.Q.M. territory. The posters there showed the broad face and bristly mustache of the party’s leader, Altaf Hussain. But as we came down Napier Road and entered Lea Market — normally overflowing with people, now practically deserted because of security fears — the kites petered out. We passed a small island of Awami National Party flags in leftist red that marked a cluster of Pashtun shops, and then the green, black, and red banners of the P.P.P. began.

Lyari’s entrance was marked by a double arch with welcome lyari town painted on it in English and Urdu. Atop the left pillar was a photo of Benazir Bhutto, the former prime minister, who was assassinated in 2007; atop the right was her father, Zulfikar Ali Bhutto, the founder of the P.P.P., who was hanged by a military dictatorship in 1979. The Bhuttos are revered in Lyari. Their photos — Benazir’s especially — could be seen on most of the political posters found there. So, however, could the image of a third figure, who was neither a candidate for the election nor a Bhutto: Uzair Baloch. A fair-skinned man with a symmetrical, pleasant face, he was in his late thirties, with a trim black beard and mustache. His eyes crinkled warmly when he smiled — as he did in most portraits — and his slightly elfin ears stuck out a little on each side.

On one set of posters, Uzair appeared with several of his fallen lieutenants. Here was Rashid Bengali, slain by a fellow gangster in an internecine dispute. There, in wraparound sunglasses, was young Fahim Badshah Khan, killed by the Rangers. Khan, like many of the martyrs, as they are called, had been photoshopped onto a Swiss-looking meadow along with a luxury SUV. In Lyari, all gangsters go to heaven.

The deeper we went into the slum, the busier the streets became. It was safer there, in territory that belonged indisputably to Uzair. People were out walking around, some of them heading toward polling stations. Others were watching us, a car with strangers, very carefully. We turned into a side alley and drove up to a group of young men sitting on plastic lawn furniture. They wore loud dress shirts, knockoff designer jeans, and ball caps. Many of them had pistols concealed in their waistbands, and nearby, I was certain, there would be men with assault rifles, rocket-propelled grenades, and belt-fed machine guns — ready to wage war at a moment’s notice. There were pickets like this all over Lyari, but the men I saw were especially attentive, because they were guarding the alley that led to Uzair’s house. They peered into the taxi and, recognizing my face, nodded for us to pass.

In 2013, Karachi recorded nearly 3,000 murders, more than any other city in the world. It hadn’t always been that way — in 2003, the official number of homicides was seventy-six. The stunning rise in violence came in the past decade, when the P.P.P. challenged the M.Q.M. for control of the city.

Until the middle of the twentieth century, Karachi was a small, Hindu-dominated city, but after the partition of India, in 1947, hundreds of thousands of Urdu-speaking Muslim refugees arrived. Despite forming a majority, these migrants, known as mohajirs, were never effectively integrated into Karachi’s patronage network. The M.Q.M. was founded in 1978 with the aim of uniting them with the rest of the city’s Urdu speakers.

By the turn of the millennium, the M.Q.M. was the city’s dominant political force. With the support of President Pervez Musharraf, a military dictator who was himself of mohajir origin, the party took over the municipal government, which led to the relative peace of 2003. But Karachi is one of the world’s fastest-growing megacities, and its demographics keep changing.

Every year, hundreds of thousands of migrants come to Karachi from the villages of Sindh and from Pakistan’s mountainous tribal areas. The newly arrived Balochis, Punjabis, Sindhis, and Pashtuns have gravitated to the M.Q.M.’s rivals, most notably the P.P.P. but also to a host of smaller ethnic and religious parties. These parties, in turn, have followed the M.Q.M.’s lead and seized whole neighborhoods with armed militias.

Everyone participates in Karachi’s lucrative bhatta economy, the system of extortion, racketeering, protection payments, and “voluntary” donations that has become inseparable from the city’s political life. (Bhatta is Urdu for “portion.”) It is this connection between politics and the criminal economy that distinguishes Karachi’s gangs from their no less violent but far more clandestine counterparts in places like Latin America. In Karachi, sometimes only the thinnest of polite fictions separates the politicians from the men who kill and extort on their behalf.

In Lyari, the P.P.P. has long worked with the neighborhood gangs to defeat political rivals and to help corral voters on election day. But in 2003, the neighborhood was divided by a brutal turf war between two rival groups, one led by Arshad Pappu, and the other by a man known as Rehman Dakait — Rehman the Bandit.

Uzair joined Rehman’s crew shortly after the war with Pappu began. Uzair had been born into a life of relative privilege and was known as a polite, subdued boy. “We used to tease him for being so quiet,” one of his elementary-school classmates told me. Uzair’s father, Faizu, was a wealthy transporter and local notable. Faizu was distantly related to Rehman, and he collected bhatta payments from the other transporters on his behalf.

Then, late one night, Pappu and his men kidnapped Faizu off the street. A few hours later, his bullet-riddled body was found stuffed in a gunnysack. Uzair vowed revenge, and quickly rose to become Rehman’s right-hand man. Rehman had plenty of brave street commanders, but he needed someone like Uzair, with his education and wealthy background, to help him enter politics.

In 2007, Musharraf bowed to mounting pressure and agreed to hold the country’s first free elections in a decade. Benazir Bhutto returned from exile to lead the P.P.P.’s campaign. In Lyari, however, the incumbent member of parliament from the P.P.P. was facing an insurrection from local organizers, who were fed up with his corruption and absenteeism. Desperate to ward off a challenge from a local, independent candidate, the party approached Rehman and asked for help fixing the elections. In return they promised a share of the spoils of office. Rehman agreed — though his task was made easier when Bhutto was assassinated while campaigning and a wave of sympathy swept the P.P.P. into power.

After the election, Rehman looked for a way to settle the gang war. Pappu was in prison (some said he had gotten himself arrested in order to avoid being killed), and only his toughest commander was still fighting in Lyari. On a hot summer day in 2008, Rehman sent Uzair to a hotel in Lyari, where the two sides swore an oath of truce. A group called the People’s Amn Committee was formed to uphold the agreement, with Rehman as its leader. (Amn means “peace” in Urdu.)

At first, the P.P.P. saw the Amn Committee as a way to roll back the M.Q.M. “They couldn’t take on the M.Q.M.’s militant wing openly,” a senior police official in Karachi told me. “Besides, they were fearful of creating a situation where there was enough chaos that the military had a pretext to intervene. So they created their own militant wing, but it became a Frankenstein and turned on them.”

In August 2009, Rehman was assassinated by the police — likely because his political ambitions were threatening the P.P.P. leadership. The next day, Uzair was appointed as the new leader of the Amn Committee. But if the P.P.P. thought they were getting a more pliant figure in Uzair, they had badly miscalculated. The party watched in dismay as he began to build an independent political base.

In the summer of 2011, Uzair met with Owais Muzaffar Tappi, a P.P.P. official and the brother of President Zardari, at the Bhutto family house. The two men clashed over Uzair’s refusal to accept political direction from the party. “I was offered twenty-five crores of contracts,” Uzair later told the press, “but I told Tappi that I didn’t need money and instead wanted Lyari’s problems to be solved. He called me obstinate and then I left.” (Twenty-five crore rupees is approximately $2.5 million; Tappi denies offering Uzair any money.)

Shortly afterward, the P.P.P. denounced the Amn Committee. The provincial government charged Uzair and the rest of the Amn leadership in several murder cases, and the police mounted a full-scale invasion of Lyari. But Uzair was ready. The Amn Committee fought back with machine guns and rocket-propelled grenades, and the outgunned cops soon bogged down in Lyari’s reticular streets. To the Pakistani media, it was a live-action gangster flick straight out of Bollywood, and the TV channels covered it around the clock. “It was like a war,” recalled Sohail Khattak, a local journalist who covered both sides of the battle. “The Amn guys had taken up fighting positions in all the frontline buildings and were coordinating with each other over their radios.”

Uzair’s men brought food and water to Lyari’s besieged residents. The Rangers, who had the arms and training to take the neighborhood by force, were absent, a sign that the military did not approve of the operation. After a week of fighting, the government called off the siege. Thirty-eight people, many of them civilians, had been killed. Lyarians blamed the P.P.P. for their suffering; Uzair was hailed as a hero.

By the beginning of 2013, with the national and provincial elections approaching, the P.P.P. faced the possibility that Uzair could take Lyari’s seats to a rival party. It chose a humiliating reversal instead. “Our demands were, first, that the cases against the leadership be withdrawn,” Zafar Baloch, one of Uzair’s lieutenants, told me. “Second, that the government agree to compensate the victims of the operation. Third, we demanded that candidates for the election should be locals from Lyari. And they accepted.”

There was one bit of unfinished business. On March 16, Arshad Pappu, who had been released from prison ahead of the police operation, was lured to a party in Defence by three cops. It was a setup. Pappu was handed over to the Amn Committee. They tortured him to death and then, late that night, brought his body to Lyari. It was a Saturday and the locals were sitting out on their stoops, drinking cheap Murree beer and smoking hash. The Amn Committee fighters came swaggering down the street, waving guns and ordering everyone to go to the square. “See the punishment that Arshad Pappu has been given,” they said.

A local who was present that night told me that one of the cops, who was later charged in the murder, was at the square pleading with the gangsters: “For God’s sake, he’s already dead, just give us the body!” But the gangsters were having fun, egging one another on, shouting, “Cut his head, cut his hands!” They chopped off Pappu’s head and started kicking it around like a soccer ball. In a video that was later posted online, men can be seen plunging their blood-slicked hands into a slit hacked in Pappu’s chest, trying to yank out his slippery, stringy organs. That was the end of the vendetta with Pappu. His cronies fled Lyari, and Uzair and the Amn Committee were left unopposed.

On election day, Uzair was stationed at a school that the P.P.P. had been using as a campaign office. His house was next door. When I arrived, I was frisked by a man carrying a submachine gun and shown into the courtyard, which was set up with posters and plastic chairs and tables. There were only a few people there — most of the campaign workers were out canvassing and monitoring polls.

Uzair was sitting alone, hunched forward sullenly, with a pistol and several phones on the table in front of him. Short and thickset, he was wearing a robe and an embroidered Balochi cap. His men were standing behind him at a distance, their faces mirroring his anxiety. Uzair smiled weakly as I entered, waved his hand in acknowledgment, and turned back to one of his flunkies. “Where are the Lassis?” he asked, referring to one of Lyari’s many ethnic groups. “Don’t we have Lassis? Have they voted yet?”

Election day was not going well. The Rangers had blocked off the borders of Lyari with shipping containers. Uzair hoped to win three seats in the National Assembly and three seats in the Sindh Provincial Assembly, and several key constituencies were split across those border areas. The M.Q.M. was far better at staffing contested polling booths, and several Amn men had been run out of their stations. The well-oiled M.Q.M. machine was teaching the upstarts a lesson. It was a critical day for Uzair — the moment he hoped to turn more of his street power into political capital — and he was worried that it was slipping from his hands.

After a few minutes, Uzair decided to tour the polling stations. He jumped to his feet and tucked his pistol into his waistband. His bodyguards sprang into action, looking relieved to be on the move again. Several rushed outside to ready the convoy while the others tightened into a protective circle around him. He walked out into the street, where a caravan of 125cc Honda motorcycles had been assembled. For a moment he contemplated the rutted dirt road, the crowd of gawkers, the hard-faced men with guns and radios, and the posters of smiling candidates, his candidates. The M.Q.M., Pappu’s cronies, even the P.P.P. — they all wanted him dead. His survival depended on whether he could bind his fate to Lyari’s and emerge on the other side, transformed. He chuckled bitterly. “I don’t even know where to go,” he said.

The day after the election, I visited Zafar Baloch at his home. Zafar didn’t usually pick up his phone until at least two in the afternoon, and the Amn men had worked through the night. It was nearly four by the time I found him sitting at the foot of his daybed drinking milky tea and watching cricket highlights on television. “Are you happy with the results?” I asked.

Zafar rubbed his face wearily. He was tall and bulky, his lips and brow heavy, but his eyes were always animated, and he was quick to laugh, exposing betel-stained teeth. “We have won a decent victory,” he said. “Now we’ll see if things continue like before.” The P.P.P. candidates chosen by the Amn Committee had won a seat in the National Assembly and two in the Provincial Assembly. Fewer than they had hoped for, but still a remarkable victory for a group that had been hunted like criminals a year earlier.

Working behind the scenes, Zafar had played a key role in the campaign. He had gotten his start as a P.P.P. activist and had once served as a municipal councillor. Now he was Uzair’s man, in a role in which his contacts with the party were exquisitely useful. “As a political worker, I understood very well that politics in Pakistan are like a war,” he said. He was a front man and political boss for the Amn Committee; he was often called upon to deliver press conferences denouncing the M.Q.M.

“When we joined Rehman, I told him, you can’t do crime your whole life, you have to do social and political works as well, then you’ll have a shelter,” Zafar said. But, at bottom, he said, Rehman had been a street thug, whereas Uzair, with his education and poise, had the potential to take the Amn Committee much further.

Zafar’s bulk on the daybed was enhanced by a cylindrical metal frame that encased his swollen right leg. His tibia and fibula had been shattered by bullets during an assassination attempt the year before and were held in place by metal rods. The flesh around the rods was infected and Zafar often seemed half-stunned from a cocktail of antibiotics and painkillers; nevertheless, he insisted on riding around Lyari’s crowded streets on the back of a motorcycle, his busted leg sticking out into traffic.

Uzair and Zafar were members of what the Amn Committee called the A Team, which controlled political decisions and citywide patronage. The muscle was the B Team: a loose and shifting confederation of charismatic gangsters who had pledged allegiance to the Amn Committee. They employed gangs of men and boys in bhatta collection, kidnapping, and various forms of vice — running brothels and casinos, loan-sharking, and drug trafficking. In both Pakistan and India, a gangster is known as a dada or bhai (“grandfather” or “brother”; the plural of bhai is bhai log), which hints at the intimate, often familial ties that bind them to one another and to their neighborhoods. As Michael Corleone puts it in The Godfather: “It’s all personal, every bit of business.”

The most feared member of the B Team was Baba Ladla, a short, stocky Lyarian who looked younger than his forty-odd years. He had grown up in a poor family in Lyari’s Bihar Colony, and his real name was Noor Mohammed. His nickname, Baba Ladla, “Little Kind One,” was ironic. In fact, he was known for his extreme violence. He was said to be responsible for the Shershah Scrap Market Massacre: in the fall of 2010, after merchants had balked at making bhatta payments, thugs had attacked the market with assault rifles, killing thirteen people and injuring dozens. “He’s ruthless and smart, the perfect combination for a mob boss,” said Omar Shahid Hamid, a city cop who oversaw the police in Lyari until 2006. “Uzair has no strength on his own without Baba and company.”

The A/B dichotomy posed a dilemma for Uzair in his quest to escape the fate of his murdered predecessor. On the one hand, to make his way into legitimate politics, he would need to rein in Baba and his commanders, and at times even serve them up to the authorities. On the other hand, to maintain his lucrative hold on the underground economy, he needed the B Team to battle the M.Q.M. and the city’s other gangs. Uzair could not disown Baba — just as Baba and the commanders needed Uzair and Zafar’s political machine to protect them.

“Now we are taking revenge,” Zafar said as we drove around the neighborhood. “Millions of rupees are collected in bhatta from the old city, and the M.Q.M. is afraid that we’re going to take that from them.”

After the election, the whole of Lyari resonated in triumph. Uzair’s men handed out sweets, and fireworks and drum processions lasted through the night. A few days later, I went to visit Habib Hasan, one of Lyari’s leading social workers and the chairman of the Lyari Resource Centre, a community building funded by the Amn Committee, which functions as a sort of nerve center for social and development work in the area. Broad-shouldered, with dark skin and short salt-and-pepper hair, Hasan had a permanently creased brow. He took me on a tour of Lyari’s schools, hospitals, and NGOs to explain just how much the neighborhood was changing thanks to Uzair. “This was a ghost house,” he said outside one school. “The gangsters used to torture people in there and do drugs. No one else came here. Now it is a high school. We have three batches of students graduating each year. It’s a surprise for all of Lyari.”

Hasan grew up in a low-caste family and started work at a young age as a donkey-cart driver and a factory laborer — the kind of clever, motivated young man for whom the gangs might have provided a path to economic mobility. But his ambition was to be educated. In those days, adults could take free literacy courses that were taught by local activists and held on the pavement, in the open. “That’s how I learned to read and write,” Hasan said, with a note of defiant pride. “I still had nothing besides my education, but I resolved that that’s what I would dedicate my life to.”

He became an instructor and activist and eventually taught the same free courses he had taken. By 2002, he had enough standing in the community to run in the municipal elections on a P.P.P. ticket, against a young Uzair Baloch — and he won. Afterward, Uzair’s father brought the two men together and told his son to accept Hasan’s victory. Uzair still treated Hasan with deference, but it was comical to think of the two as rivals now. The old order had changed beyond recognition in the past decade.

Hasan left politics with the advent of Rehman and Pappu’s gang war, despairing at what was happening in Lyari. But when Uzair became leader of the Amn Committee, he started calling around to Lyari’s social workers, asking for help starting a community center. “The Amn Committee wasn’t organized at that time, it was just a name, not a party, not an organization,” said Hasan. “I had reservations. I told him, ‘You have armed men, how can we work in the same environment?’ ”

Uzair, he recalled, was insistent. “He said, ‘Give us a chance. No one will interfere with your work. We will give you all kinds of support, books, an office, protection if anyone threatens you — just make our schools a better place.’ ”

Uzair was as good as his word, Hasan told me as we drove past the refurbished Lyari General Hospital, behind which a new medical school was being built. During the Musharraf Administration, nothing had been built in the neighborhood, a deliberate policy, Hasan and many Lyarians believed, that was intended to sap the strength of a P.P.P. stronghold. The area’s elected officials stole the few development funds that were apportioned. “None of them ever came to Lyari,” he said. “Even the police stations were involved in crime.”

When the P.P.P. came back to power in 2008, $28 million in new funding was earmarked for Lyari. Uzair used the Amn Committee’s muscle to ensure that corruption was kept within reasonable bounds. “Uzair’s principle was that the work should get done,” Hasan said. “Okay, there’s corruption, people take their cut, but in the end the projects should be finished. And they were. Uzair forced them to complete them on time, and to maintain their quality.”

Just as important was the end of the gang war within Lyari, and an ensuing ban on street crime that was enforced by the Amn Committee. “Uzair said, ‘Let’s finish the big crimes — robbery, drug peddling,’ ” Hasan told me. It was true. I felt safer inside Lyari than I did in most other places in Karachi, including the wealthy enclaves, where carjackings and robberies at gunpoint were common. In Lyari, muggers, rapists, cell-phone snatchers, and drug touts knew to ply their trade elsewhere, or get a bullet in the head. I would sometimes stay in Lyari with friends past midnight, and we’d walk the streets, which were full of locals browsing vegetable stands and munching on sticky, sweet jalebis. Only the borderlands near the M.Q.M.’s territory were abandoned, and tense. “People call them criminals, but they’ve built hospitals, schools, and social projects,” said Akram Baloch, a former journalist who became the head of the Amn Committee’s media team. “In these circumstances, you must make compromises.”

Like so many robber barons before him, Uzair understood that philanthropy was the path to respectability. Some of his efforts had already borne fruit. When the police and Rangers raided Lyari in 2012, the residents demonstrated in the streets, decrying the killing and arrest of “innocents.” “Ek Lyari sab se bari, Uzair bhai, Uzair bhai,” they chanted: “One Lyari, stronger than any, brother Uzair, brother Uzair.”

Around the corner from the Lyari Resource Centre was the rooftop Youth Café, where a crew of kids was putting up straw screens against the sun and painting the concrete walls with colorful murals. Excited to see a foreign visitor, one of the kids walked up to me. “Sir, let me show you my Michael Jackson dance,” he said, before doing a rendition of “Thriller.” As the others crowded around, I recognized one of the older boys; he had worked on a security detail during the election, and was in the process of transitioning from a scout and gofer into someone tasked with more serious jobs — I had seen Uzair’s men let him handle their pistols. Here, though, he was a kid again, giggling as the runty M.J. let a slow-motion wave ripple from one skinny wrist to the other.

For Hasan, kids like these were the reason he’d made an alliance with Uzair. Lyari could support educated youth whose talent and vigor would balance that of the bhai log in the streets, a new generation that would expiate the sins and compromises of their fathers. “There is an education revolution happening right now in Lyari,” he said. “Of course it’s not a democratic culture. But it’s our only chance.”

For a moment, it seemed like the peace would hold in Lyari. The days after the election brought the hottest part of year, when even the nightly sea breeze turned languid and stifling. In summer, Pakistan’s chronic electricity woes become a crisis. The city flickered like a dying bulb as power came in shorter and shorter spurts; when the lights went out and the fans stopped, the little cinder-block apartments seemed to press in on their occupants. Even the drunks on their stoops seemed too heat-stricken to shout.

Then, a week after the ballots were cast, a group of Baba Ladla’s men walked north past Hingorabad Road. This was the dividing line between his group’s turf and that of the Kutchi Rabta Committee, a rival armed group. The K.R.C. occupied Agra Taj, a small corner of Lyari that was populated mostly by Katchis, one of Karachi’s ethnic minorities. As far back as anyone could remember, the Katchis had lived in peace with the Baloch-dominated neighborhoods around them. But in 2009, when a group of Katchi businessmen stood up to the Amn Committee’s attempts to extend bhatta collection to Agra Taj, open warfare had erupted. The K.R.C. had turned to the M.Q.M. for assistance and now, to the Amn Committee, Agra Taj represented an unacceptable foothold for their mortal enemies in Lyari.

On the evening of May 18, 2013, three men under Ladla’s command entered Agra Taj armed with a submachine gun and two Kalashnikovs and started firing into a crowded street. Eight people died in all, including a twelve-year-old girl. Word spread quickly that another spasm of violence was coming, and the neighborhood resounded with a preparatory commotion: the rasp of shutters being pulled down; a mother’s frantic cell-phone call; the wail of an ambulance; feet pounding up staircases, bearing the weight of cans of ammunition; the roar of Honda motorbikes. The K.R.C. hit back by opening fire from their rooftops. The two sides battled with machine guns and rocket-propelled grenades as the people in the neighborhoods cowered in their homes.

The battle raged for twenty-four hours. I arrived at the tail end of it, weaving through the traffic jam on a motorcycle driven by my Katchi-speaking fixer. A mob of younger boys started throwing stones at us until he shouted at them frantically in their native tongue. We pulled into a side alley; ahead we could hear the rattle of automatic weapons. Agra Taj’s streets were even filthier than the rest of Lyari. There was no trash collection, and a tremendous amount of plastic garbage had accumulated in the lanes.

We turned down another alley. The fighting was almost over, and in the sheltered back streets families were coming out to stretch their limbs after a day stuck inside crowded apartments. They pointed to where stray bullets had pocked satellite dishes and windowsills and conferred about where to find milk and other essentials.

We parked the bike. A little farther down the alley, half a dozen young K.R.C. fighters were crouched together. Some of them were leaning on long-barreled assault rifles. I could hear the metallic snick-snick of bullets being slipped into magazines. Their leader, a heavyset kid with a bowl cut, introduced himself as Haider.

He told me that they had been up all night exchanging fire with the Amn Committee. They looked shell-shocked from their first real taste of combat. When I made a clumsy joke about treating them to lunch, only Haider laughed, a soft, mirthless chuckle as his gaze slid up and down the alleyway.

I asked whom they were fighting on the other side. “It’s Jasim Golden and Fahim Baloch, both are part of Baba Ladla’s crew,” Haider said. He pulled out a phone to show me pictures of them. He knew an awful lot about the bhai log — later I would learn that he had once been a leader of the M.Q.M. cadres in Lyari, and had a long rap sheet.

Once the firing stopped, the Rangers and police showed up. The locals jeered. “Where were you when we were getting slaughtered?” shouted one old man as he shook his bony fist at an armored personnel carrier. The mob became rowdier, and the Rangers fired some tear-gas canisters and then live ammunition over our heads. We ran back with the crowd into the side streets. When some of the people there realized that I was a foreigner, they formed a curious knot around me and shouted their complaints. “Lyari is like Afghanistan!” one man exclaimed. Another came up and handed me a heavy silver cylinder as long as my palm; it was a VOG-25P bounding fragmentation grenade, fired from behind Amn lines. It had, thus far, failed to explode.

As the fight with Baba Ladla’s men continued over the next few days, Agra Taj began to feel like an open-air prison. Residents started stockpiling milk and water, and those who lived closest to the front lines tunneled through their walls in order to create unexposed escape routes. But if the urban warfare in Karachi was astonishing in its intensity, it was also highly localized, limited to the slums and poor neighborhoods of the periphery. Certain evenings, in another universe, at some cocktail party at a mansion in Defence, I’d be interrupted by a call summoning me to the latest outbreak of violence, and, slightly tipsy, I would have my driver rush me across town and deposit me at the border of Agra Taj, where my fixer would be waiting with his motorcycle.

On one night, in an alley where the K.R.C. fighters had cut the power, we skirted a large puddle by the glow of our cell phones. We advanced gingerly until, from a group of obscure figures, a man’s voice hissed, “Put out the light!” The man then beckoned me to a fighting position barricaded with sandbags. He pointed down the deserted alley toward a set of pale, faint shapes — the enemy was only thirty yards away. “There’s twenty or twenty-five of them down there,” he said.

The houses nearby had been evacuated of women and children, and the men and boys had all come down into the alley to form a communal defense in case of a raid by the Amn side. The youngest was fifteen, and the oldest was around seventy, the teen’s grandfather, a man with stooped shoulders, a bushy white beard, and a scarf tied up under his chin and over the top of his head. He said he had lived in Agra Taj his whole life. It had always been a peaceful area, but now here they were at the barricades, like guerrillas.

I asked whether they had any experience or training with the weapons they were using. “This is our training,” he said.

When the P.P.P. came to power seven years ago, businessmen in Karachi no longer knew whom to pay off. “The recent deregulation of the market of protection, following the gradual loss of control of the M.Q.M. over revenue collection,” writes political scientist Laurent Gayer, in Karachi: Ordered Disorder and the Struggle for the City, distressed the city’s mercantile and industrial classes. The change “paved the way for increasingly violent and arbitrary forms of extortion.”

The owner of a large factory in the eastern part of the city told me a typical story. For years, he had been giving small sums to the various political parties in his neighborhood, perhaps a few hundred dollars a month, to keep them happy. As a supporter of the M.Q.M., he voluntarily contributed larger payments to that party. But early in 2013, he received a phone call from someone claiming to be allied with the Amn Committee. The man demanded a lump sum of $25,000. “We said, ‘Who are you, can you prove it?’ ” the factory owner recalled, as we sipped tea in his palatial home in Defence. “He said, ‘I’ll prove it in thirty minutes.’ ” Around half an hour later, men on motorcycles fired a burst of bullets into the storage area at the back of the factory.

The negotiations continued over the next three weeks as the owner pleaded for a lower bhatta payment. In the meantime, he worked his contacts in the police and the military. “But everyone we talked to said that if it’s the Amn Committee, then there’s nothing they can do, they’re connected with the government,” he said. Eventually, they settled on monthly installments of $4,000. The owner said that after the first payment the man divided the money into four stacks and said, ‘This is for the Rangers, this is for the chief minister, and this is for the police. And this is our share.’ Now he sends his guy every month, saying ‘My man is wearing this color cap.’ They’re absolutely unafraid of doing this openly.”

Uzair, meanwhile, continued to consolidate political power. Immediately after the swearing-in ceremony for new members at the Provincial Assembly, while the fighting in Agra Taj continued, a delegation of high-ranking P.P.P. leaders traveled to his house in Lyari for a lavish banquet.

When I visited Uzair a few days later, he sardonically recounted all the P.P.P. dignitaries who had been there, the same notables who had called for him to be arrested the year before. Political necessity had brought them together, but their alliance would last only as long as Uzair had something to offer. The fate of his predecessor weighed heavily on him. “They tried to use me like they used Rehman,” he said.

I asked him if he ever imagined what his life would have been like had his father not been killed by Pappu. “It overturned my life completely,” he said, and sighed. “Before that, I was just a normal kid, but then I had to manage his business, manage the welfare of the community, meet with all the people — I had to become a man of the people.”

He paused a moment, then fixed me with a pleading gaze. “I am not a don,” he said in English, and chuckled gently. I noticed that there was a biography of Nelson Mandela under the table. Some guests arrived — representatives of communities around the city seeking Uzair’s favor — and I excused myself. He offered me these parting words: “Whoever supports and cares for the poor people, I am with them.”

Uzair refused to allow me to interview any of the Amn Committee’s B Team commanders. In some ways he was as much their prisoner as their leader, a figurehead who could not escape their demands. “People think that Uzair is the big boss and leader of Lyari, but the criminal elements are the real behind-the-scenes power,” the senior police official told me. “He can only influence them so far, especially Baba Ladla, who is a power of equivalent standing.”

The last time I saw Uzair, he was in full politician mode, entertaining a wealthy society lady from Defence who was interested in philanthropic work in Lyari. She seemed enthralled by him; he in turn was taking great pleasure in showing her around his many projects. We traveled in a convoy and stopped at a blood bank that he was funding. The locals gawked as Uzair stepped out, surrounded by machine gun–toting bodyguards and trailed by the lady in her colorful robes.

The blood bank was a well-made one-story clinic, though the drywall inside was still being hung. We stepped into the courtyard, which had been decorated in a style common to warlords’ mansions and wedding halls in Pakistan and Afghanistan — what might be called Rococo grotto. There were mirrored columns, fake gilding, and elaborate chandeliers, along with rustic touches such as plaster trees, plastic flowers, and animal statuary. One wall bulged with tree trunks that had stubby, shorn limbs. A concrete parasol in the shape of a giant mushroom sprouted from the ground, and in the center was a stepped fountain with a dangling, tonguelike waterspout. The wall had been partially painted in orange and green; the rest of the décor, with its pale, raw texture, looked like cake icing.

“Did you design this yourself?” I asked Uzair.

“I will show you the designer,” he said, grinning. “Baba! Come here, Baba!”

One of the men in the garden came toward us hesitantly. He was dressed in a salmon-colored shalwar kameez, with a checked scarf tied like a bandanna over his forehead. He was short but muscular, with high cheekbones and a square, handsome jaw. He looked around bashfully as he shook our hands. I realized that he was Baba Ladla.

“Baba Ladla designed this garden?” I said in astonishment. Ladla beat a hasty retreat.

“He is wanted, Ladla,” Uzair said with a snicker to the society lady, using the English word.

Seeing my expression, one of Uzair’s advisers remarked, “Inside of every bhai, there is an artist.”

Six months after that meeting, in March 2014, I attended a rally in front of the Karachi Press Club, which serves as a focal point for demonstrations in the city. Several hundred residents of Lyari had gathered to protest the violence in their neighborhood; they were arrayed in rows, with the women at the front. “No more gang war!” they shouted to the television cameras, as a group of bored-looking police officers watched.

Riven by mistrust, Uzair and Baba turned on each other, and both had fled the country. The Amn Committee had split into two rival groups of bhai log who were killing each other mercilessly, egged on by the city’s political powers. The inciting incident had been the assassination of Zafar Baloch, who was shot near his house by motorcycle-riding gunmen. The gangsters’ intimate knowledge of one another’s hideouts and methods made their attacks all the more effective; each day brought tit-for-tat assassinations and kidnappings, and every week a battle involving machine guns and rockets would erupt in Lyari’s streets, causing scores of civilian casualties.

“If the people don’t stand up for themselves, there won’t be peace for anyone,” said Mahagul Baloch, an eighteen-year-old member of the Baloch Human Rights Organization, the local activist group that had organized the rally. “As for Uzair, he’s not a leader, he’s a gangster.”

The anger against the gangs was palpable, but there was something perfunctory to the demonstration as well. It was always the same routine in Karachi: get together at the Arts Council, walk a few hundred yards to the press club while the police held back traffic, chant slogans for an hour until the news cameras got their fill. It was hardly enough to make your presence felt above the din of the city; for the rest of Karachi, it was just another spat among thugs in Lyari.

Arbab Ali, a cameraman from Samaa TV, stood watching the protesters, a pack of Gold Leaf cigarettes in his hand. I asked him how many rallies like this he usually saw. He shrugged. “Sometimes we have twelve in one day,” he said. “Let’s see, there was the rickshaw-drivers’ union here before today, and some teachers. There will probably be two or three more.”

Lyari was no longer the open space it had been during Uzair’s reign. Entering the slum now meant navigating carefully around the latest trouble spots. The Lyari Resource Centre, which was near the front line between Baba and Uzair, had been closed. I found Habib Hasan at home in a glum mood. “When war begins, your fate passes out of your hands,” he told me.

Zafar’s death had taken him by surprise. He shook his head. “This was an announcement. Zafar was running the system in Uzair’s absence; they announced that the system was finished.”

The political power of the Amn Committee had been broken; Lyari’s pot was kept boiling again. Everything that Hasan had been working for, all the dividends of peace, had been put on ice. “All those projects I showed you? They’re stopped. Nothing can happen when there’s no security,” Hasan told me. I asked him if he had made a mistake allying himself with Uzair, and his face darkened.

“You think I’m on the same team as them?” he said, and then sighed. “I took a risk for my people, for my community. Maybe it was a mistake.”

What would happen next? In May 2014, Baba was reportedly killed by Iranian guards while trying to cross the border — though I was told his family has yet to receive his body, and there were rumors in Lyari that he was still alive. This April, Uzair was released by the Emirati authorities, shortly after he leveled his accusations against Zardari. The Pakistani government had been curiously inept in its attempts to extradite him; its delegations kept getting turned back at the Dubai airport with improper paperwork. One officer had even mistakenly brought along his service pistol. The threat of Uzair’s sensational story had, like the man himself, disappeared, though one Karachi news channel recently reported that he was in the custody of Pakistan’s intelligence agencies.

“They will decide if Uzair will come back, or if it is someone else’s turn,” said one of my friends in Lyari. It was a familiar refrain: events in Lyari were controlled by dark, hidden forces. But was the alternative thought — that Karachi’s chaos has grown too unpredictable for anyone to master — any less terrifying?