Correction: An earlier version of this story omitted the last name of a dentist shown with his personal security guard. His name is Ibrahim M. Zafar, not Ibrahim Muhammad.

Dentist Ibrahim M. Zafar gets out of his car as an armed guard holds the door in Karachi’s upscale Clifton neighborhood. The inability of government security forces to control the city has left private citizens feeling that they have to fend for themselves. (Max Becherer/Polaris)

Armored car sales have soared, and some new luxury apartments feature bulletproof glass. Local police officers, slain this year at an average rate of one per day, are demoralized. And now even the journalists are trying to arm themselves.

Pakistan’s biggest city has been plagued by crime and political violence for decades, with Urdu- and Pashto-speaking groups battling for influence. But the bloodshed is worsening as the domestic Taliban insurgency expands.

The militant group was largely responsible for a 90 percent spike in terrorist attacks in Karachi last year, according to the Pak Institute for Peace Studies, which monitors violence. In the latest such attack, an explosion tore through a bus carrying police Thursday morning, killing a dozen officers. The Pakistani Taliban claimed responsibility.

The bloodshed in this city reflects the Pakistani Taliban’s growing national offensive against the government and religious minorities. But the insurgents are also using violence to take control of some city neighborhoods, where ordinary residents are forced to contribute to their cause, analysts said.

The mayhem is raising concerns that one of the world’s most populous cities is teetering on the brink of lawlessness.

“Something must be done soon, if Pakistan is to be saved,” said Nasir Jamal, a deputy director of Muttahida Qaumi Movement (MQM), a major political party.

Parents take their children to school hand in hand in the morning on the streets of Karachi. The city has seen an increase in violence and crime. (Max Becherer/Polaris)

A memorial poster is posted for a butcher who was killed when a car bomb detonated between apartment buildings in the Shiite neighborhood of Abbas Town. (Max Becherer/Polaris)

Prime Minister Nawaz Sharif insists that Karachi can be tamed through targeted security operations and peace talks launched last monthwith the Pakistani Taliban. But residents of the country’s economic and cultural hub are deeply worried.

“Everyone is just waiting their turn to be killed,” said Zamin Ali, son of a prominent Shiite attorney who was fatally shot outside a Karachi courthouse in July, part of a surge of sectarian killings being carried out by the Taliban and other Sunni-dominated militant groups.

For all the unrest, Karachi hardly resembles Baghdad or Mogadishu. It is home to dozens of international corporations, the Pakistan stock exchange and two major ports. Streets remain busy well into the night as residents flock to upscale shopping malls and events such as a new dolphin show at the aquarium and Pakistan’s first performance of the Broadway musical “Grease.”

Yet, that semblance of normality is increasingly being tested by Islamist militants surging into the city from northwest Pakistan and Afghanistan, part of a larger migration that has caused the city’s population to nearly double in just over a decade, to about 22 million.

Residents take in the setting sun from their caged-in balcony in an apartment building in Abbas Town, a Shiite neighborhood that has seen a rise in sectarian violence as a result of the lack of law and order in Karachi. (Max Becherer/Polaris)

The city has long suffered from violence linked to gangs, drug traffickers and political mobsters. But now, some areas of the city look increasingly militarized. In the Kati Pahari neighborhood, where a mountain of orange-tinged rock looms over the city, heavily armed officers man checkpoints, stopping cars in search of militants traveling from police no-go zones in the vast slums on the outskirts of town.

The influxbegan after the U.S.-led invasion of Afghanistan in 2001 caused al-Qaeda fighters and Afghan Taliban to flee that country. More recently, Karachi has become a haven for militants escaping U.S. drone strikes and Pakistani military operations in northwest Pakistan.

When The Washington Post recently asked a senior Karachi police commander how many Taliban sympathizers live in the city, he bluntly said, “A couple hundred thousand.” He spoke on the condition of anonymity because of fears for his safety. Other officials and analysts estimated that the number of active militants is far less — 10,000 to 15,000, including those aligned with groups such as Lashkar-e-Taiba and Lashkar-e-Jhangvi.

The Pakistan Taliban, also known as Tehrik-e-Taliban Pakistan (TTP), formed when various Pakistani militant groups coalesced in 2007 and early 2008. It claims to be independent of the Afghan Taliban. But the groups are believed to coordinate activities. Both are dominated by Pashtuns, the biggest ethnic group in southern and eastern Afghanistan and western Pakistan.

For years, Karachi had been plagued by ­clashes between Mohajirs, Urdu speakers who long dominated this economic hub, and Pashtuns, who were newer arrivals. But now, even Pashtuns say they feel threatened.

‘Increasing their power’

A mechanic walks past a passenger car stripped and ready to be retrofitted with armored plates and glass at the Pak Armoring factory in Karachi. (Max Becherer/Polaris)

An armed guard takes a drink of water in front of a retrofitted Toyota Land Cruiser and an armored police truck at the Pak Armoring factory. (Max Becherer/Polaris)

Zia Ur Rehman, author of the book “Karachi in Turmoil,” said at least 10 percent of the city’s residents live in neighborhoods effectively controlled by the Pakistani Taliban.

“Day by day [the Taliban] is increasing their power, and there is no hope of betterment,” said Abdul Rauf, a local leader in the Pashtun-dominated Awami National Party. He said 17 party officials were killed in his central Karachi district alone last year by Taliban insurgents seeking to control Pashtun neighborhoods.

Huma Yusuf, a Karachi-based researcher, said the rise of Taliban influence is making the city more ungovernable. She said that during prior conflicts between politically and ethnically based groups, there was usually someone who could step in to ease tensions because the various actors had financial and cultural stakes in the city. The Taliban, she said, “doesn’t answer to anyone.”

According to the Human Rights Commission of Pakistan, 3,251 people died in violence in Karachi last year, which local news media outlets called a record high. Official police statistics show 2,507 killings last year, up from 2,124 in 2012. In January, 216 people were killed, including 28 law enforcement officials, police said.

Chaudhry Aslam, superintendent of the police Criminal Investigation Department, was killed in a suicide bomb blast. (Max Becherer/Polaris)

In one killing that shocked this city, the head of the police Criminal Investigation Department was assassinated in January when a car packed with explosives rammed his convoy. The Taliban asserted responsibility for the attack against Chaudhry Aslam, who had gained a reputation for relentlessly pursuing militants in the city.

A week after Aslam was killed, Karachi was jolted when three employees of Express News Live television network were shot at point-blank range as they sat in their news van. The Taliban asserted responsibility, saying it was taking revenge for the station’s recent reporting on the group’s activities. The assassinations came on the heels of a grenade attack in December and a shooting outside the TV station in August. Reporters and other station employees are now seeking permission to carry weapons, said Aslam Khan, the bureau chief.

“And it’s not just because of the Taliban,” Khan said.

Indeed, as the threat from militancy grows, Yusuf said, other criminals are finding “more space” to terrorize residents through kidnapping, extortion and robbery.

Karachi’s police force is roughly the size of New York City’s — even though its population is three times as big — and its officers are overwhelmed, Yusuf and several officials said. Criminals increasingly claim to be working for the Taliban, when they have no actual ties to the group, police said.

Muhammad Taqi Alvi, a local newspaper editor, said he was driving with family recently when gunmen threw tires in front of his car. His wife and three small children were taken hostage, and the gunmen — who said they were affiliated with the Taliban — demanded $20,000 for their release. After three hours of negotiation, they settled for $120.

“For three hours, we hung between life and death,” Alvi said.

Ibrahim M. Zafar, a 33-year-old dentist, recently hired a 24-hour armed guard for his office after being robbed at gunpoint at a traffic light. He said he and his friends have also stopped using smartphones and wearing expensive watches in public.

Ibrahim M. Zafar recently hired a 24-hour armed guard for his office after being robbed at gunpoint at a traffic light. (Max Becherer/Polaris)

Others are rushing to reinforce vehicles, at a cost of up to $50,000, amid a wave of killings being carried out by men on motorcycles.

“It used to be protection from small-arms fire, but now there are hundreds of thousands of Kalashnikovs and high-powered rifles on the street, so now people want protection from that,” said Khurrum Hamirani, a businessman who relocated his armored car business to Karachi several years ago after business slowed in Baghdad. He said his business grew by 100 percent last year.

Perhaps the most telling sign of the city’s troubles is the sense of helplessness gripping the police force.

“The bombproof cars we have can only handle 25 kilos” — 55 pounds — of explosives, the senior police commander said, adding that the Taliban had used more than 200 pounds of explosives in killing Aslam. If the militants attack, he said, “it’s just not possible to secure us.”

Nisar Mehdi in Karachi contributed to this report.