Insurgents first killed the security guards at the hotel, then stormed inside and began firing at guests who were dining. Some of the guests escaped while others were held hostage as the attackers battled Afghan security forces who rushed to the scene for the next 12 hours.
Kabul police said all five attackers had been shot and killed by midday, ending the stand-off. Afghan President Hamid Karzai condemned the incident, the latest in a string of attacks this week that suggest the Taliban is pushing hard with its summer offensive rather than waiting for international forces to draw down.
The strike at the Spozhmai hotel at Qargha Lake, about a half-hour drive from the capital, was a reminder that the Taliban can still hit very close to the seat of the Afghan government.
Fourteen Afghan civilians, three security guards and an Afghan police officer died in the attack, said Mohammad Zahir, criminal director for Kabul police.
"The attackers entered the hotel and suddenly opened fire on families having a late dinner," Zahir said. "The hotel was crowded. Some of the guests jumped from the window into the hotel yard. They were hiding under trees or any safe place they could find. "Three of the guests jumped into the lake and hid in the water," he added.
The attackers were armed with machines guns, rocket-propelled grenades and vests laden with explosives.
They stormed the hotel before midnight and by midmorning militants were still fighting Afghan forces, supported by international troops. Gunfire pierced the quiet surroundings of the lake area. Black smoke was rising from the two-storey hotel in a wooded area on the bank of the lake. Nato helicopters circled overhead.
Taliban spokesman Zabiullah Mujahid said the Taliban attacked the hotel because foreigners there were drinking alcohol and participating in other activities banned by Islam, but that was disputed by the Kabul police.
The hotel, on a man-made lake, is a popular place for well-to-do Afghans to spend Thursday night - the beginning of the Afghan weekend - or for picnic excursions on a Friday when paddleboats and horse rides are on offer. Though international workers do go to Qargha lake, Afghans make up the majority of the clientele at the hotels and kebab shops along its shore.