Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

KABUL, Afghanistan — At least 14 foreigners and four Afghans were killed after gunmen stormed the Intercontinental Hotel in Kabul on Saturday, a spokesman for the Afghan Interior Ministry said.

The attack set off a 13-hour gun battle with security forces in an overnight siege, as frantic guests tried to escape from fourth and fifth-floor windows.

Interior Ministry spokesman Najib Danish said that 11 of the 14 foreigners killed were employees of KamAir, a private Afghan airline.

Another ministry spokesman, Nasrat Rahimi, said that nine of the dead were Ukrainian, one was Greek, two were South African and another was from Kazakistan.

The nationality of one of the victims wasn’t yet known, Rahimi said.

Ten other people, including six security forces and four civilians, were wounded, he added. While more than 150 people, including 41 foreigners, were rescued from the hotel.

A State Department official said it was working with local authorities to determine if any victims are American.

Danish said the siege ended on Sunday when the last gunman was shot dead. The Afghan Taliban claimed responsibility for the attack and said their targets were foreign forces including U.S. troops.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Capt. Tom Gresback, spokesman for NATO-led forces, said in a statement that according to initial reports, no foreign troops were hurt in the attack.

Afghan security personnel stand guard as smoke rises from the Intercontinental Hotel after an attack in Kabul, Afghanistan, Sunday, Jan. 21, 2018. Rahmat Gul / AP

As guests fled the hotel, some could be seen shimmying down tied-together sheets from upper-floor windows in order to escape.

One man told NBC News that his friend's life was spared because he told the attackers they were local.

"They entered our room and that of our friend's and asked them where are you from?" Mumtaz Ahmad told NBC News. "Our friend answered from Jalal-Abad so the attackers replied you are okay no problem."

The attackers seemed to be targeting people working with the government or with foreigners, he added.

The Intercontinental Hotel is located on a hilltop in the Bagh-e Bala area of the capital and is heavily guarded because it hosts both Afghan and foreign guests as well as official conferences. Saturday's attack unfolded almost six years after Taliban insurgents launched a similar assault.

Related: ‘Still in a stalemate,’ top U.S. commander in Afghanistan says

The property is not part of the InterContinental chain of worldwide hotels.

Taliban spokesman Zabihullah Mujahid said the group deployed five suicide bombers armed with hand grenades and AK-47 assault rifles. NBC News could not verify this claim.

The Interior Ministry said a private firm assumed responsibility for securing the hotel around three weeks ago. The ministry says it is investigating how the attackers managed to enter the building.

Afghan policemen keep watch close to the entrance gate of Kabul's Intercontinental Hotel during an attack by gunmen in Kabul, Afghanistan. OMAR SOBHANI / Reuters

Afghan security officials confirmed that 34 provincial officials were gathered at the hotel to participate in a conference organized by the Telecommunication Ministry.

The attack started around 9 p.m. Saturday and caused a fire to break out at the building. As day broke on Sunday, thick clouds of black smoke could be seen pouring from the building, according to Reuters.

Gresback, the spokesman for NATO-led forces, said in a statement that the Afghan forces led response efforts.

U.S. Ambassador to Afghanistan John R. Bass said in a statement that he condemned the "heinous" attack on the Intercontinental Hotel in Kabul and said the U.S. embassy was in close contact with Afghan authorities who are continuing to investigate the incident.

Afghan forces have struggled to combat the Taliban since the U.S. and NATO formally concluded their combat mission at the end of 2014. They have also had to contend with a growing Islamic State affiliate that has carried out a number of massive attacks in recent years.

Interior Ministry spokesman Nasrat Rahimi said that nine of the dead were Ukrainian, one was Greek, two were South African and another was from Kazakistan.

The nationality of one of the victims wasn’t yet known, Rahimi said.