A security official said at least five people were found dead inside, while authorities continued to search for the remaining attackers. The official spoke on condition of anonymity because he was not authorized to release information on the attack.
As the fighting took place, Mr. Rauf and hundreds of other guests spent the night hiding in rooms, wondering whether they would live or die. They were still there at dawn Sunday as sporadic gunfire continued, and most were still alive.
“Why can’t the police rescue us?” Mr. Rauf said, after five hours in his second-floor hotel room. He said he lay there listening to gunfire and taking cellphone calls, with his phone on silent.
In another room on the second floor of the six-story, 200-room hotel, Haji Saheb Nazar, 45, also an employee of Afghan Telecoms, hunkered down in the toilet cubicle. He was so convinced he would not survive the night that he called home to say his goodbyes. “I told my family that maybe I would be killed, I didn’t know.”
On the street outside, the men’s boss, Minister of Telecommunications Shahzad Aryobee, was frustrated that the police would not let him get close to the building, which was partially in flames, as occasional explosions broke out. Mr. Aryobee tried to reach by phone the 105 staff members he said were inside to reassure them. “I’m here, I won’t leave you, help is coming,” he said.
There was little the minister could do but look on helplessly as the night wore on, with temperatures well below freezing, until morning came and authorities claimed they had retaken control of the hotel.
There were fears of a much larger death toll, in part because similar attacks have proven more deadly. But in the morning, the security official said only five bodies had been found, with half of the building still uncleared.
However, officials indicated they did not have yet have full control of the hotel.
“Our special forces are entering the building,” said Gen. Afzal Aman, commander of the Kabul Garrison, an elite unit of police and soldiers that is responsible for security in the capital, who was reached by cellphone at the scene. “The attackers are at one side of the building. There are guests trapped in their rooms. We do not know who are the attackers.”
Hotels in Kabul have long been a favored target of various insurgents, and Saturday’s attack was the second time gunmen forced their way inside that hotel; in a 2011 attack, they went room to room, executing anyone they found.
The Intercontinental is one of the most heavily guarded places in the capital and benefits from sitting on a fortified hilltop. It is also a symbol of the Afghan state. Built in the 1970s as part of the Intercontinental Hotels chain, it was seized by the government after the Soviet invasion of Afghanistan. During the ensuing civil war it was heavily damaged in shelling by rival mujahedeen factions, then rebuilt after the Taliban were defeated.
Now, most of its 200 rooms are occupied by government officials and official guests; foreigners rarely stay there because of security concerns.
No group has claimed responsibility for the attack. In recent months, the Islamic State’s Afghan faction has claimed it carried out several high-profile attacks in the capital, and others have been attributed to the Haqqani Network, a Pakistan-based faction of the Taliban.
President Trump has vowed to cut off aid to Pakistan because it has continued to give shelter to insurgents, but the Taliban have also proven adept at encouraging more attacks in Afghanistan when it has served their interests.