Heavily armed Taliban militants stormed a top Kabul hotel, sparking a ferocious battle involving Afghan commandos and a NATO helicopter gunship that left at least 21 dead including the nine attackers.
Officials said all of the gunmen were killed during the night-time raid on the hilltop Intercontinental Hotel, frequented by Westerners and Afghan officials, part of which was left in flames as tracer bullets lit up the sky.
The state-owned 1960s hotel, which is not part of the global InterContinental chain, was hosting delegates attending an Afghan security conference and a large wedding party when the insurgents struck.
The ministry and the government in Madrid said a Spanish man - reportedly a pilot working for a Turkish airline - was also killed at the hotel.
Interior ministry spokesman Seddiq Seddiqi said the slain hotel workers had been on the first floor and in the lobby at the time of the attack.Among those staying at the hotel were provincial government officials who were in Kabul for a conference on the handover of power from foreign to Afghan security forces. The process starts next month.
The attackers steered clear of the normally heavily guarded road snaking up to the hotel, instead picking their way through the trees on the northern slope towards the building around 11:00pm on Tuesday, police said.
Panicked guests were told to stay in their rooms as the attackers, thought to have suicide vests, machine guns and rocket-propelled grenades, roamed through the building for about four hours before the raid was quelled.
Major Tim James, a spokesman for NATO's International Security Assistance Force, said ISAF deployed one helicopter at the request of Afghan authorities.
Taliban spokesman Zabihullah Mujahid said the militant Islamist group was behind the attack, which comes weeks before foreign forces are expected to start withdrawals from Afghanistan.