Media playback is unsupported on your device Media caption Afghan forces led the operation against the gunmen, with help from international forces, as Quentin Somerville reports

Afghan security forces have ended a 12-hour attack by Taliban militants on a hotel outside Kabul, in which at least 20 people died, officials say.

Insurgents attacked the Spozhmai Hotel in the Lake Qargha area on Thursday night, taking many hostages.

Kabul's police chief said 15 civilians, including hotel guests, died. All five insurgents were killed.

The Taliban claimed the attack, saying the hotel was used by wealthy Afghans and foreigners for "wild parties".

Lake Qargha is on the outskirts of Kabul and is favoured by residents of the Afghan capital for day trips and family outings.

Analysis The Taliban say they were attacking an "immoral" lakeside hotel. In fact, they picked an easy target - Afghan families, celebrating the weekend, by a lake which offers some relief from the heat and dust of Kabul. The unarmed guests were taken hostage by men with machine guns and rocket-propelled grenades. The insurgents said this was a hotel frequented by foreigners. Some foreigners do visit the area, but usually on day trips. Few stay overnight. There aren't foreign troops in the area. Despite the loss of life, this falls far short of the large-scale attacks which have taken place in the Afghan capital. It appears designed to inflict as many casualties as possible, and grab headlines. Afghan security forces, mentored by foreign troops, tackled the insurgents. It took them 12 hours to kill all the attackers, and there was foreign air-support, but Afghan forces were in charge.

The BBC's Quentin Sommerville, in Kabul, says this was an easy target for the Taliban, in a fairly remote area, with little security.

Foreigners rarely visit the lake, our correspondent says.

In addition to the five militants, those killed included civilians, hotel guards and a police officer.

Dozens of people were taken hostage.

AFP news agency photographer Massoud Hossaini, who went into the hotel after the siege ended, told the BBC: "All the walls have been torn apart with bullets; all the furniture and all the things that were there like carpets are torn and damaged.

"I saw the bodies of some fighters and their bodies were in bits and pieces. There are a lot of bullets casings here, lots of them."

The gunmen, armed with rocket-propelled grenades and heavy machine guns, launched the attack on the hotel late on Thursday, officials say.

Gen John Allen, of the Nato-led International Security and Assistance Force, said the "unspeakably brutal attack" bore the "signature" of the Haqqani group.

"There is no doubt that innocent Afghan civilians were the intended targets," he said in a statement.

Gunfire

Maihan Saeedi, who left the area shortly before the attack began, told the BBC the hotel was full of civilians, including women and children.

The area was busy because it was Thursday night, the start of the Afghan weekend.

"When we left the hotel, we heard gunfire as we reached one of the [three security] checkpoints near the hotel," he said.

"I'm completely shocked at how people managed to cross these checkpoints - it really raises questions over the levels of security, which is all commercialised."

High-profile attacks on Kabul 15 April 2012: Seven sites including parliament, Nato HQ and foreign embassies attacked

29 October 2011: Suicide bomber attacks bus carrying Isaf staff, killing 13 foreigners and four Afghans

13 September 2011: Gunmen seize unfinished high-rise to fire on Nato HQ and US embassy

19 August 2011: Gunmen storm British Council HQ, killing 12 people

28 June 2011: 22 people die after militant attack on the Intercontinental Hotel Changing views of Afghan forces In pictures: Lake Qargha siege

He said one of his friends inside the hotel told him by phone that people were trying to escape by jumping out through the windows and into the lake.

"It just shows that the Taliban are there to kill civilians," Mr Saeedi said.

The Taliban attacked the hotel because foreigners there were drinking alcohol and participating in other activities banned by Islam, Taliban spokesman Zabiullah Mujahid told the Associated Press.

The security operation was led by Afghan security forces, with support from the US-led coalition.

In recent months, the Afghan army and police have taken the lead in battling some of the most challenging insurgent attacks, winning praise and a measure of support from the Afghan population.

Violence has recently increased across the country, with at least three US soldiers and about 20 Afghans killed in a series of attacks over the past seven days.

The attacks come as Nato gradually hands responsibility for security to Afghan forces, ahead of the departure of combat troops in 2014.