Afghan special forces have killed all the gunmen who opened fire on guests at the Intercontinental hotel in Kabul, leaving at least six dead, an official said.

Its dreams of a caliphate are gone. Now Isis has a deadly new strategy | Hassan Hassan

Read more

The claimed five of its militants, wearing suicide vests, carried out the assault which began on Saturday night and led to a 12-hour gun battle when Afghan forces stormed the building.

The interior ministry deputy spokesman, Nasrat Rahimi, told Agence France-Presse one foreigner was among the dead. “The body of the foreigner, a woman, was recovered from the sixth floor as the last attacker was being killed,” he said. About 150 people were rescued including more than 40 foreigners, he added.

As dawn broke on Sunday, thick clouds of black smoke could be seen pouring from the hotel. Several armoured US military vehicles with heavy machine guns could be seen close to the hotel along with Afghan police units.

Television pictures also showed special forces troops manoeuvering on the roof as they conducted a floor-by-floor search of the six-storey building to find the attackers.

Several people could be seen climbing over a top-floor balcony using bedsheets to escape, with one losing his grip and plunging to the ground.

Black smoke rises from the Intercontinental hotel after an attack in Kabul. Photograph: Rahmat Gul/AP

The militants also took hostages from among staff and guests, and set the building ablaze. Firefighters were still battling to put out the blaze on Sunday afternoon.

The hotel’s location in Kabul.

The militants launched the attack at about 9pm local time on Saturday, security officials said. Rahimi said they were armed with light weapons and rocket-propelled grenades.

Afghan security officials said 34 provincial officials were at the hotel to attend a conference organised by the telecommunication ministry. The interior ministry spokesman, Najib Danish, said a telecommunications official from the western Farah province was among the dead.

Aziz Tayeb, a regional director for Afghan Telecom, told AFP: “Everything became chaotic in a moment. I hid behind a pillar and I saw people who were enjoying themselves a second ago screaming and fleeing like crazy, and some of them falling down, hit by bullets.”

He said he and a few friends managed to escape to the hotel’s outdoor pool area where they hid, listening to the horrifying attack metres away.

“I could repeatedly hear blasts one after another, hand grenades, they used many grenades,” he said.

“We contacted security officials who arrived an hour later and as we were being escorted out I saw five or six bodies outside the hotel.

“The second, third and fifth floors were on fire – the fifth floor was engulfed in flames.”

The gunmen had entered the hotel through a kitchen door to evade heavy security at the front, local news reports said. A hotel employee, speaking on condition of anonymity, told AFP that the security team fled “without a fight”. He said: “They didn’t attack. They didn’t do anything to them. They had no experience.” The interior ministry said a private security firm had assumed responsibility for protecting the hotel just three weeks earlier.

Two guests at the hotel confirmed that the militants attacked when they were eating, and that people in the dining room had attempted to flee. Ahsan Ali told the Observer: “People ran to their rooms and locked themselves in – it was a dreadful scene.”

The gunmen then broke into guest rooms, taking dozens of hostages, witnesses said.

It was the latest blow to security in the Afghan capital, which has been reeling from a string of bloody attacks by both Taliban and Isis militants.

In May last year a huge , killing about 150 people and wounding about 400 others.

The most recent major attack was on 28 December, when a , killing more than 40 people.

The attack on the Intercontinental came just two days after the US embassy put out a warning that militants might be planning to target hotels in the city.

The blaze on the top floors of the hilltop complex could be seen from across the city. Commando forces were sent in, and electricity was cut soon after the attack began, amid fears that guests had been taken hostage.

One of the most famous buildings in Kabul, the Intercontinental was a playground for the city’s elite when it opened in 1969, with parties around the swimming pool and weddings in its halls.

It was later a base for foreign journalists during the civil war that followed the Russian withdrawal, then during the period of Taliban rule and the US-led invasion in the wake of the 9/11 attacks on America. in an attack that killed 21 people.