Story highlights More than 30 people killed and at least 50 others injured

Attackers dressed in medical uniforms set off bombs before storming the hospital

Kabul, Afghanistan (CNN) 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 near 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.

Security forces and police mounted a counteroffensive. Heavily armed soldiers and armored vehicles surrounded the facility, a helicopter landed on the roof and a few patients climbed out of windows and stood on a ledge to escape the violence, video shows.