People mourn at the graves of three polio vaccinators who died in a suicide bombing in Kabul on March 1. (Sayed Salahuddin/for The Washington Post)

Behroz Haidary was a skilled surgeon, army captain, environmental activist and father of three. On Wednesday, he was making rounds at Kabul’s main military hospital when he was shot dead by gunmen who had infiltrated the facility, disguised as medics. It was his 37th birthday. The attack, claimed by the Islamic State, left at least 49 people dead and 70 wounded.

Abdul Qadir, 23, was a laborer from a poor neighborhood, with a part-time job as a government vaccinator. On March 1, he was giving polio drops to a girl outdoors when a suicide bomber rammed a nearby police station. The blast hurled Qadir into a ditch, and his charred body was found hours later. He was one of 23 people who died that day in twin attacks claimed by the Taliban.

Haidary and Qadir were among the most recent victims of the urban terror war in Afghanistan, a series of bombings and gun attacks that officials fear will intensify this year, with insurgents gaining territory and civilian deaths reaching a record 3,500 nationwide in 2016. In Kabul alone, such attacks have killed thousands in the past decade — and nearly 100 this month.

But most of the 16-year war has been fought in far-flung rural provinces, and most civilian victims as well as security forces die there. Often there are few witnesses and no detailed news coverage, so the deaths remain a remote abstraction. 

Afghans cry after an attack on a military hospital in Kabul on Wednesday. (Rahmat Gul/Associated Press)

When a convoy carrying supplies to snowbound villages was ambushed last month in Jowzjan province, leaving six aid workers dead, their names and faces remained unknown to the public. The same was true when a policeman fatally shot 11 of his sleeping fellow officers at a desert checkpoint in Helmand province two weeks ago.

But when terrorist violence invades the capital, the impact is more immediate; destruction and death zoom into public view. Television crews quickly reach bombing and shootout scenes. People post constant queries and reactions on social media — a mix of worry, relief, anger about the endless war and frustration about the government’s inability to protect the public.

“We are supposed to thank the president for going to visit people in the hospital and condemning a savage act,” one resident wrote Thursday on Facebook. “But saying sorry and condemning are not enough. Why can’t they do more to prevent it?” 

On Thursday, the Ministry of Defense said the military hospital had been sealed shut while investigators try to discover how the attackers entered the hospital after blowing up the main gate. On Wednesday, security officials said they had driven an ambulance into the compound. 

Officials also said they were trying to confirm whether the Islamic State was behind the attack, as its news outlet claimed. The Taliban issued a statement saying it had not been involved, but the group sometimes denies attacks that kill many civilians.

A posting on Facebook showed five masked men posing with assault rifles in front of a sign in Arabic naming them as “our sacrificers” in the “killing and maiming of mercenaries” at the military hospital. There was no way to tell where and when the photo was taken.

When the victims of such fatal attacks are well-known figures, their losses can resonate across social media and Afghan society. On Thursday, the news of Haidary’s death sparked an outpouring of condolences on social media, and photos of him with his children and colleagues circulated online.

He was buried at the hillside Deh Kapaik cemetery, below a monument to Marshal Mohammad Fahim, the late anti-Soviet militia leader and defense minister, with whom his family had military and ethnic ties. A portrait of Haidary in his army uniform rested among the flowers on his grave. Mourners in military garb raised occasional shouts of “Allah is great.”

But colleagues from medical, environmental and academic circles also testified to his contagious good spirits and desire to help build a modern, professional Afghan society.

“Behroz was an exceptional person who cared about his country and thought about big issues,” said Samim Hoshmand, a friend at the crowded burial ceremony, which Afghan TV crews filmed. He brought five pine saplings to plant nearby. “He told me we must all die someday, but we can all keep something alive after us,” Hoshmand said.

In contrast, the death of Qadir one week earlier was virtually unnoticed in public and mourned quietly by relatives and neighbors. Yet he and his two fellow vaccinators were much more ­typical of victims of urban terrorism — people selling fruit or used clothing, riding buses or praying in mosques, going about daily routines in a dangerous, crowded city. 

Qadir’s body lay for hours in a culvert, alongside those of his two friends, lost in the citywide chaos of a double bombing and gun battle. That night, relatives finally located it in a forensic hospital. For their day’s work delivering polio drops, the three would have each taken home $23.

Word spread quickly through their community, and the next morning, hundreds of men gathered to carry their pine coffins through the alleys to a prayer ceremony and then a small graveyard, where they were buried side by side in plain earthen mounds. 

“He was a humble, honest, easygoing person. He had dreams for his life, like all of us,” said Ahmad Samir, a cousin close to Qadir. “He was saving to buy a small flat for his mom, because their house was old and leaked a lot when it rained.”

These families, too, were angry at the war, at the government, at the fate of these ordinary young men who had done nothing to deserve a horrific death.

“We are losing our youths every day in this war,” said Mohammad Gul, a retired police officer whose son Jalal died with Qadir. “Our government leaders have their families abroad and they are safe in expensive villas. America is doing nothing to stop this war. How long do we have to die? Why are they killing us? Who is there to answer our question?”

The day after Qadir died, Samir and another friend made a poster of his photo. It showed him smiling and handsome, with a fashionable haircut. In the cemetery, they planted the poster next to his grave. Across the top was written one word in Afghan Dari: ­“Martyr.”

Sayed Salahuddin and Sharif Walid contributed to this report.