KABUL, Afghanistan — Sardar Ahmad, a warmly admired stalwart of the Afghan journalistic community here, loved to post bits of wisdom from his young daughter, Nelofar, on Facebook.

“Baba, do the Taliban kill animals as well?” began one exchange he posted last July.

“No!” he replied.

“I wish we were animals,” Nelofar declared.

In a horrifying turn of fate that has devastated his peers and colleagues, Mr. Ahmad and his family became the Taliban’s quarry last week. He, his wife, Humaira, and two of their children — Omar, 5, and Nelofar, who had just turned 6 — were among the nine people killed by militant gunmen at the Serena Hotel on March 20. Their 2-year-old son, Abu Zar, is the family’s sole survivor, critically wounded after being shot three times, including in the head.

On Wednesday night, journalists in Afghanistan gathered atop the Wazir Akbar Khan hill overlooking Kabul’s old city to hold a candlelight vigil remembering the journalist and his family.

It was a measure of how bad things had become that although hundreds came, no one stayed more than half an hour, after the police warned that it would not be safe to do so — even atop a well-guarded hill in the midst of the city’s diplomatic enclave. “I wish we could have continued the event for a few more hours,” said one of Mr. Ahmad’s friends, Ahmad Mukhtar, a CBS journalist. “It is a pity that we are not even in a position to remember our friend even after his death.”

The mourners gathered after dark to light candles and lay flowers before poster-size photographs of Mr. Ahmad with his children. The hilltop, unlit at night, has commanding views of the city’s lights on the sprawling plateau around its base.

Mr. Ahmad was well known as an avid fisherman, a resourceful journalist working for Agence France-Presse and an entrepreneur who had started the news agency Pressistan, which trained local journalists and provided services to journalistic clients.

He had a gusto for life, and especially food, and was the object of good-natured kidding from friends for his frequent social network postings of pictures of his meals, sometimes several a day, which perhaps had prompted him recently to buy a treadmill for exercise.

Video

Scenes of police officers standing guard near a luxury hotel that was attacked by gunmen in Kabul, Afghanistan.Published OnMarch 21, 2014CreditImage by Bryan Denton for The New York Times

He and his wife made a thoroughly modern Afghan couple. Humaira had an 11th-grade education and looked forward to finishing her studies when the children were a little older, and he frequently spoke out in favor of girls’ education. Though his wife stayed at home with the children, he did not keep her in purdah, as many here do, and instead seldom missed an occasion to take their young family out on the town.

Last Thursday, on the eve of the Afghan New Year, Nowruz, the family went to dinner at the luxurious Serena Hotel. They were in the midst of their meal when four militants barged in with tiny pistols hidden in their socks, shooting Mr. Ahmad first and then two of his three children, even after their mother pleaded for them to kill her instead.

But they killed Nelofar and Omar in front of her, then killed her, according to witnesses interviewed later. Finally, they sprayed bullets even at little Abu Zar.

After lying in a coma for four days in the Italian-run Emergency Hospital, the gravely wounded child has revived and has been doing surprisingly well in recent days. He is now sitting up and eating, visitors and friends said. Mr. Ahmad had few relatives to whom he was close, however, and it is unclear who will take custody of the boy.

President Hamid Karzai issued a statement the day after the attack calling it “the biggest crime, and a painful tragedy.”

The fate of Mr. Ahmad and his family struck a sensitive chord throughout the press corps here. The American Embassy rescheduled a news briefing so as not to conflict with Wednesday’s vigil. Taliban officials took pains to insist they had not deliberately killed them, blaming crossfire instead.

Zabiullah Mujahid, the Taliban spokesman, even issued an unusual apology. “There is no acceptable way to defend the deaths of these children, and we regret their deaths,” he said in a telephone interview, as a child could be heard squealing in the background.

Nonetheless, after the attack many Afghan journalists vowed to boycott reporting Taliban statements and news releases for 15 days.

When Afghan journalists convened at the Kabul morgue to identify Mr. Ahmad’s body, Shah Marai, a photographer with Agence France-Presse, told his colleagues of a recent car trip with his friend. “Shah Marai,” Mr. Ahmad said then, “we have survived and covered so many battles and suicide bombings, it would be such a shame if we were killed in a cowardly attack.”

A version of this article appears in print on , on Page A13 of the New York edition with the headline: Mourning a Family Cut Down in Kabul. Order Reprints | Today’s Paper | Subscribe