This is an archived article and the information in the article may be outdated. Please look at the time stamp on the story to see when it was last updated.

KABUL, Afghanistan — Gunmen disguised as medical personnel stormed a military hospital near the US Embassy in Kabul on Wednesday, killing at least 30 people in a six-hour siege before Afghan security forces killed the attackers, authorities said.

The ISIS-affiliated news agency Amaq said the terror group claimed responsibility for the attack, the latest at a public building in Kabul’s heavily fortified diplomatic quarter.

First a suicide bomber blew himself up at the south gate to the Sardar Mohammed Daud Khan hospital, said Sediq Sediqqi, Afghan Interior Ministry spokesman. Known as “the 400-bed hospital,” it’s the country’s biggest and best-equipped medical facility.

Three gunmen then invaded the hospital, made their way to the second and third floors and opened fire, Sediqqi said. Among those killed were Afghan military personnel recovering from battle wounds, doctors and hospital employees.

Afghan security forces and police mounted a counteroffensive at the hospital. Video showed heavily armed soldiers and armored vehicles surrounding the facility and a helicopter landing on its roof and discharging soldiers.

Soldiers killed the attackers around 3:30 p.m. local time (6 a.m. Wednesday ET) after six hours of fighting.

As soldiers cleared the building, they discovered bodies and the number of casualties quickly grew.

More than 50 people were wounded and taken to the Wazir Akbar Khan hospital, said Smael Kawosi, media relation officer for the Ministry of Health. It’s not known if any security personnel or police officers were killed.

The Taliban has claimed credit for other recent attacks. But a Taliban spokesman, Zabiullah Mojahid, denied responsibility for this rampage in a tweet, saying: “Today’s attack on hospital in Kabul has nothing to do with the Mujahidin of Islamic Emirate,” using the group’s formal name.

In the vacuum of a Taliban claim, Amaq said ISIS claimed responsibility. Though it is credible that ISIS planned and carried out the attack, CNN has not independently verified the claim.

This is not the first attack at the hospital named after Afghanistan’s first president. In May 2011, suicide bombers got inside, and killed six people and injured 26 others. The Taliban claimed responsibility.

Explosions, then gunfire

Witnesses told CNN an explosion was first heard around at 9 a.m. local time (11.30 p.m. Tuesday ET).

Afghan National Police special forces rushed in to counter the attack.

“At first there was a firing followed by a huge blast,” an employee at a nearby hospital said.

An employee at an Italian restaurant nearby said she heard one explosion around 9 a.m., then heard gunfire about 25 minutes later.

The attackers were not immediately killed because security forces were busy evacuating patients, the defense ministry statement said.

Attack condemned

Afghan President Mohammad Ashraf Ghani said the attack shows terrorists “don’t follow rules and laws.”

“According to international humanitarian laws, hospitals are immune from attacks,” he said.

Afghan Chief Executive Abdullah Abdullah tweeted: “I condemn the terrorist attacked on hospital in Kabul. While we work for peace, we’ll avenge the blood of our people.”

The US Embassy in Kabul said, “Targeting a medical facility providing care for the brave Afghans working to protect their fellow citizens has no possible justification in any religion or creed.”

NATO forces in Afghanistan indicated that the organization was standing by to assist Afghan security forces, according to tweets from Operation Resolute Support.

“Once again insurgents show complete disrespect for humanity by attacking a hospital. We stand with Afghan people against terrorism.”

The NATO tweets condemned the attack, using an older name for the hospital.

US Army Gen. John Nicholson, commander of Resolute Support and US Forces in Afghanistan, said the attack “is an unspeakable crime.” He praised Afghan security forces for the swift response, saying the forces deserve “our highest praise and respect.”

Soft targets

Militants have long targeted loosely guarded targets in Kabul and across Afghanistan. Last month, at least 20 people died after a suicide blast outside Afghanistan’s Supreme Court in Kabul, police and other officials told CNN.

A suicide bomber detonated his explosives in a parking lot near the court in the Afghan capital, according to Basir Mojahid, spokesman for Kabul’s chief of police.

Earlier in the year, a spate of attacks — two suicide bombings near the Afghan Parliament in Kabul, an explosion at a Kandahar province government compound and a suicide bombing in Helmand province — left dozens of people dead and wounded.

The Taliban claimed responsibility for the Kabul attacks, which killed at least 36 people and injured 76 others in the capital.

Last summer, seven students, three police officers and two security guards were killed in the attack on the American University of Afghanistan campus in the capital.

Police searched the university’s grounds and killed two attackers who stormed the campus with guns and explosives, Fraidoon Obaidi, chief of Kabul police’s criminal investigation department, said. The gunmen detonated explosives and fired guns, witnesses said, causing some students and faculty to flee.