On a warm summer evening, with peacocks strutting amid the patio chairs and moonlight reflecting off the lake, the Spugmay Restaurant is one of the most elegant sanctuaries in Kabul, a place where the war feels almost far enough away.

Seven young men changed that with sickening speed Thursday night. Armed with guns and grenades and explosives strapped over their baggy clothes, a minivan-load of Taliban fighters stormed through the ivy-draped restaurant’s arched gateway, transforming a relaxed evening on the water into another scene of smoke, blood and broken glass. Over the course of Thursday night and Friday morning, the insurgents executed diners and staff and fought a prolonged gun battle with security forces.

By the end, at least 20 people lay dead, including restaurant patrons, cooks, guards, police and all seven of the attackers, according to Kabul police chief Ayoub Salangi. But the insurgents proved once again that few places, even in the heavily policed capital, lie beyond their reach.

The choice of targets — a restaurant frequented primarily by Afghan families — was somewhat unusual for the Taliban, which has tended to marshal its limited resources to assault symbols of government or U.S. military power, such as armored convoys, ministries or Western embassies. But the insurgents have also attacked hotels, shopping centers and supermarkets in recent years.

In claiming responsibility for the attack, Taliban spokesman Zabiullah Mujahid characterized the restaurant and nearby Spozhmai Hotel as a den of booze, prostitution, dancing and “wild parties” that catered to foreigners and was an affront to Islam. But Afghan police strongly disputed the description, saying the resort on Qargha Lake outside Kabul was frequented by Afghans relaxing with their families.

The top U.S. commander in Afghanistan, Gen. John R. Allen, said the attack bore the signature of the Haqqani network, a Taliban-allied insurgent group based in the tribal areas of Pakistan. The Haqqani group, which U.S. officials believe has links to Pakistan’s intelligence service, has organized many of the most dramatic and deadly assaults in Kabul. Its ruthlessness and effectiveness have made it one of the most important enemies of U.S. troops in Afghanistan.

“There is no doubt that innocent Afghan civilians were the intended targets of this unspeakably brutal attack,” Allen said in a statement.

“This is a crime against humanity because they targeted children, women and civilians picnicking at the lake,” said Gen. Mohammad Zahir, chief of the Kabul police investigation unit. “There wasn’t even a single soldier around there.”

The insurgents arrived at the Spugmay in a minivan at around 11:30 p.m. Thursday — the start of the Afghan weekend — while the restaurant was full of guests, some smoking hookahs under pine trees on the lawn, others eating lamb kebabs on the rooftop terrace. In the parking lot, the gunmen shot the manager’s brother and security guards, then charged through the front door, past a sign that read “No guns allowed.”

Sharif Aloko and 11 of his friends were sitting on the patio when the gunmen entered. One of them shot a father and his daughter while family members pleaded, “Please don’t kill us.”

A gunman then killed another guest, grabbed his cellphone and made a call, Aloko recalled in an interview. “He said, ‘Hafiz, I am here. Pray for me to succeed. So far the security forces have not arrived.’ ” After ending the call, Aloko said, the attacker shouted at his men to preserve their bullets.

One of the cooks said he jumped out the kitchen window and cowered behind a hedge the entire night. Other guests leapt into the lake, and one drowned as he tried to escape, according to Afghan officials. One man was fatally shot while smoking a cigarette, which was still in his fingers as he lay dead.

Afghan police stationed down the street ran into the parking lot but were repulsed. Eventually, Afghan reinforcements, backed by NATO helicopters and Norwegian special forces, arrived at the restaurant and battled the attackers.

“What we did for two hours was just protect the surrounding areas,” said Salim, one of the Afghan policemen who responded to the attack. “Nobody could dare come close to the gate. They were on the roof, and it was well lit, so whoever tried to come in they would shoot. Even if we lit a lighter they would shoot at us.”

Police said the Taliban released women and children in the morning. By mid-morning, when Afghan troops killed the last insurgents, the restaurant was pocked with bullet holes and littered with shell casings. Dead insurgents lay slumped on stairways and inside toilet stalls.

“When these attacks happen, the people definitely start hating the Taliban,” said Omid Sherzada, a 20-year-old former waiter at the restaurant, who came by to survey the wreckage. “I saw one guy sitting on the grass crying, saying, ‘Imagine, these are Muslims, and they’re doing this kind of killing.’ ”

The slaughter seemed less shocking to others.

“We were thinking one day this restaurant would come under attack,” said Mohammed Latif, a 35-year-old policeman who is stationed near the Spugmay. “There were foreigners coming and drinking alcohol here. We are Muslims, and our law and path is the holy Koran.”

Special correspondent Javed Hamdard contributed to this report.