Officials said the death toll from the attack on the six-storey Intercontinental Hotel, claimed by the Taliban, could rise as staff were still checking rooms.
The overnight assault on the hilltop hotel overlooking the Afghan capital, which ended Sunday, sparked dramatic scenes as guests climbed down bedsheets tied to balconies to escape. One lost his grip and fell in television footage by Afghanistan's Tolo News station, which also showed black smoke and flames billowing from the hotel.
Special forces were lowered by helicopters during the night onto the roof of the landmark 1960s building. Afghan security forces killed all six attackers, the interior ministry said. Earlier the ministry had put the number of attackers at four.
They were aided by Norwegian troops, Norwegian military officials told public broadcaster NRK. Norway has helped train Afghan elite forces since 2007.
"Five Afghans and one foreigner have been killed," interior ministry deputy spokesman Nasrat Rahimi told AFP Sunday, adding around 150 people were rescued.
"The body of the foreigner, a woman, was recovered from the sixth floor as the last attacker was being killed," he added.
Ukrainian foreign ministry official Vasyl Kyrylych confirmed that one of its citizens was among the dead and said the Ukrainian consul was flying to Kabul.
Najib Danish, another interior ministry spokesman, said 41 foreigners had been rescued and warned the death toll could rise as authorities were still checking each room. At least six people were wounded, the interior ministry has said.
It was not clear how many people had been inside the hotel. The CEO of Afghan airline Kam Air, Captain Samad Usman Samadi, said 42 of its personnel had been there -- at least 16 of whom are still missing.
"We fear for their lives," he told AFP.
The Taliban claimed responsibility for the assault via email. The attack followed security warnings in recent days to avoid hotels and other locations frequented by foreigners in war-torn Kabul, one of the deadliest places in Afghanistan for civilians.
"We are hiding in our rooms. I beg the security forces to rescue us as soon as possible before they reach and kill us," one guest, who did not want to be named, told AFP by telephone during the siege.
His phone has been switched off since then.
'Fleeing like crazy'
Officials said four gunmen burst into the hotel, which is not part of the global InterContinental chain, on Saturday night, opening fire and taking dozens of people hostage.
Afghan Telecom regional director Aziz Tayeb, who was one of dozens of people at the hotel attending an IT conference, said he saw the attackers enter.
"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," Tayeb told AFP.
Local resident Abdul Sattar said he had spoken by phone to friends who are hotel staff and had been trapped inside.
"Suddenly (militants) attacked the dinner gathering... (then) they broke into the rooms, took some people hostage and they opened fire on some of them," he told AFP.
Rahimi said the attackers were armed with light weapons and rocket-propelled grenades when they stormed the hotel, a popular venue for weddings, conferences and political gatherings.
Security in Kabul has been ramped up since May 31 when a massive truck bomb killed some 150 people and wounded around 400 -- mostly civilians.
But the resurgent Taliban and Islamic State are both scaling up their assaults on the city, with multiple devastating attacks in recent weeks.
The attack on the Intercontinental was just one of several bloody assaults on Sunday. In a village in the northern province of Balkh, Taliban militants went from house to house in the middle of the night, pulling police from their homes and shooting them dead. At least 18 officers were killed, deputy police chief Abdul Raziq Qaderi told AFP. In Herat in the west at least eight civilians were killed when a car hit a Taliban-planted roadside mine, officials there said.
The last major attack on a high-end hotel in Kabul was in March 2014 when four teenage gunmen raided the Serena, killing nine people including AFP journalist Sardar Ahmad.
The overnight siege is not the first time the Intercontinental has been targeted: in 2011 a suicide attack claimed by the Taliban killed 21 people there, including 10 civilians.
Danish said authorities were questioning how the attackers got past the hotel's security, which was taken over by a private company three weeks ago.
"We will investigate it," he said.
A hotel employee told AFP that as he fled the hotel he saw the new security guards running for their lives.
"They didn't do anything, they didn't attack. They had no experience," the man said on condition of anonymity.