Taliban militants armed with guns and rockets attacked a lakeside hotel near Kabul overnight, seizing dozens of hostages including women and children and killing at least 18 people.
It took the government 12 hours to declare the brazen assault on the Spozhmai Hotel over with all four militants killed, after security forces earlier freed a number of the hostages.
The attack is likely only to exacerbate fears that insecurity is spiralling as NATO combat troops prepare to exit the Afghan war in 2014.
The US commander of NATO troops in Afghanistan blamed the Al-Qaeda-linked Haqqani network for orchestrating the assault, the latest in a series of spectacular commando-style raids on hotels, government and Western targets in Kabul blamed on the faction.
On a balcony overlooking the lake, a birthday cake lay half eaten on a table surrounded by a dozen empty chairs, while nearby sprawled the bloodied body of a young man shot repeatedly in the chest. Like many of the victims, he was dressed in Western clothes, an AFP reporter said.
The Spozhmai is a haunt of the wealthy Kabul elite and on Thursday nights -- the start of the Afghan weekend -- is usually packed with families and mixed groups of men and women.
The Taliban attacked as people gathered for a late dinner.
At least one of the militants detonated an explosive suicide vest, said Mohammad Zahir, the head of Kabul police criminal investigation department.
Witness Sharifullah, 30, had gone to the Spozhmai for dinner with a friend.
"I saw three armed men entering the area where people, families, had gathered. Moments later the shooting broke out, people panicked and started screaming," he told AFP.
"I threw myself in a ditch but saw bullets hitting a father, his son and wife who were sitting around a table near me. I am not sure if they survived."
The standoff ended at 11:00 am, when the fourth attacker was killed, the interior ministry said.
Ministry spokesman Sediq Sediqqi said the attackers killed 18 people, including three hotel guards and one policeman.
The Taliban, who are leading a bloody insurgency against Karzai's Western-backed government, told AFP that the hotel was attacked because of "wild parties, drinking and prostitution" every Thursday.
Spokesman Zabihullah Mujahid accused foreign diplomats, and members of the US-led NATO mission and the Kabul government of attending the hotel's Thursday gatherings.
Qargha lake lies around 10 kilometres (six miles) from central Kabul and its pleasant weather and greenery make it a popular picnic spot for daytrippers from the capital. The lake is surrounded by hotels, restaurants and wedding halls.
General John Allen, the US commander of NATO troops in Afghanistan accused the Pakistan-based Haqqani network of orchestrating the siege, saying it "bears the signature of the Haqqani network".
Earlier this month, Defense Secretary Leon Panetta said the United States was running out of patience with Pakistan over its refusal to eliminate terror havens.
NATO intends to withdraw its 130,000 combat troops by the end of 2014, exiting the costly war that has killed tens of thousands of Afghan civilians and more than 3,050 foreign soldiers.
President Hamid Karzai warned Thursday that attacks on Afghan police and soldiers were increasing, saying that 20 to 25 personnel were being killed every day.
On Wednesday, a suicide bomber attacked a joint Afghan-NATO patrol in the eastern city of Khost, close to the Pakistan border, killing 21 people including three US soldiers.
Hotels, guest houses, government buildings, embassies and military bases in Kabul have been a frequent target of commando-style insurgent attacks.
In April, militants launched coordinated attacks on government offices, embassies and foreign bases in Kabul in the biggest assault on the Afghan capital in 10 years of war.