QARGHA LAKE, Afghanistan — A minivan pulled up to the entryway of the Spozhmai Hotel just before midnight on Thursday, and what appeared to be seven Afghan women in characteristic head-to-toe blue burqas piled out.

Throwing off the burqas, the women proved to be male insurgents, bristling with weapons and wearing bulky suicide vests packed with explosives. They raced into the hotel, crowded with hundreds of Afghans enjoying the lakeside coolness of a summer evening — one of few places in the Kabul area where families and young people can go for a night out.
“Where are the prostitutes?” the intruders demanded as they shot their way through the hotel restaurant, according to accounts by the police and survivors. The attackers shot the manager and three unarmed hotel guards, who would be among at least 20 people the attackers managed to kill before their own deaths, mostly by suicide, finished the raid.
There were no prostitutes, as it turned out, and apparently no foreign guests either, which Taliban spokesmen later claimed that they had been targeting.
One of the guests who managed to escape, Shah Mohammed, 25, said the seven attackers divided up. Some stalked the restaurant inside the building; others went to the rooftop terrace, with its splendid view of the lake and the barren mountains behind it; others out to the garden between the hotel and the lake shore, where many of the diners were seated.
Going from one table to another, they shot any male they could find at point-blank range, but appeared to spare women and children, witnesses and officials said. Hundreds of guests were evacuated in the early hours of the raid by Afghan security forces; 45 holed up in the hotel grounds and were held as hostages until the police took control Friday morning.
Four diners in the garden jumped into the lake, fed by cold mountain streams, and, unable to swim, clung to a wall until rescued by police officers hours later.
Six military policemen were among the victims, who otherwise were mostly young civilian men in their 20s. A young Afghan man who had emigrated and returned from London for a visit was in the restaurant with a friend. They split up; the friend escaped, but the Afghan was killed.
The Taliban claimed responsibility for the attack, saying that Afghans and foreigners drank alcohol there and that there was prostitution and dancing. “These acts are illegal and strictly prohibited in Islam,” said Zabiullah Mujahid, a Taliban spokesman. “Women dancers were sexually misused there.”
While there was no evidence of sexual activity of any sort, at many of the tables, amid pools of blood and unfinished meals, there were some cans of beer. Many restaurants in the Kabul area allow guests to bring their own alcohol.
The police arrived at the hotel about midnight. Suspecting that the minivan was booby-trapped, they opened fire on it with a rocket-propelled grenade as a precaution; the resulting blast confirmed their suspicions. The burned-out skeleton of the minivan could be seen outside the main gate on Friday.
Police officials described the sprawling resort at Qargha Lake as a daunting place to mount a rescue operation because the area was wooded and provided easy cover for attackers. “There are lots of trees; it’s like a jungle, which makes it difficult for us to spot the attackers,” said a security official as the siege unfolded. He spoke on the condition of anonymity because he was not authorized to talk to the news media.
In addition to the main hotel, the resort includes at least one other hotel and numerous small cottages.
“The Afghan security forces managed to evacuate 250 to 300 customers at the hotel in the initial hours of the attack, and in the morning we resumed our operation,” said Gen. Ayoub Salangi, the Kabul police chief, on Friday morning. “So far we’ve managed to rescue 40 more hostages, including women and children.”
The attack was the latest against civilians by the Taliban, who stormed a branch of Kabul Bank in Jalalabad in early 2011, executing customers. Nearly a year ago, they attacked the Intercontinental Hotel in Kabul, killing at least eight people.
Early Friday morning, gunfire broke out as the Afghan police fought the assailants and prepared a counterattack, said Gen. Mohammed Zahir, head of the Kabul Criminal Investigation Division. The police said at least two of the attackers appeared to have died when they detonated suicide vests they were wearing.
“The Spozhmai Hotel is not a military facility, it’s a civilian hotel,” General Zahir said. “We still do not know why the Taliban targeted the Spozhmai Hotel.”
Journalists at the scene could hear one loud explosion after another as the attackers apparently detonated their vests; at least six of their bodies, badly mangled from the explosions, could be seen immediately after the police regained control.
American helicopters were shooting flares and the area was swarming with Afghan National Police and army troops. NATO officials confirmed that it was a joint operation, and Norwegian special forces troops were seen joining in the fighting, while American special forces teams were present as advisers.
The picturesque hotel is the centerpiece of the resort, which was once the property of Afghanistan’s royal family and is now owned by the government. About 10 miles from the capital, it is one of the few places in Kabul Province where people can go for a break from the crowded city streets. There are boats for rent and cottages for families, and the resort is popular with families on the Thursday and Friday weekend.
The lake is also a favorite spot for young Kabul residents who buy illegal alcohol and drink it in the picnic areas.
Sadruddin Razayae, a finance officer at a private university, said picnics at places like Qargha Lake were among Kabul’s’ few diversions. “Now it seems they are chasing us even there, they are stealing our happy moments,” he said. “This heartbreaking attack made me very sad.”
In a statement posted on their Web site on Friday, the Taliban said the resort area included “prime places in Kabul for prostitution and parties.”
The Taliban said the hotels in the area were “usually used for immoral and unethical purposes, both for the foreigners and their puppet colleagues.”
A waiter at the hotel, Mohammed Wais, 21, said the attack began as he was in the kitchen slicing onions. “Suddenly we heard shooting outside the hotel, we heard shouting and yelling and then somebody said, ‘They shot the guards, they shot the guards,’ ” he said.
He and several other workers escaped, Mr. Wais said, but at least 20 others were trapped. He said they stayed in touch with their friends by exchanging text messages until 3 a.m. Friday, when, he said, “their phones were turned off.”
As ambulances arrived Friday morning to take away the dead — there were relatively few wounded; the police said they numbered only 10 — surviving family members, mainly women, screamed, wailed and begged to ride along with the victims.
Habib Zahori reported from Qargha Lake, and Rod Nordland and Alissa J. Rubin from Kabul, Afghanistan. Jawad Sukhanyar contributed reporting from Kabul.