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

KABUL, Afghanistan — Gunmen dressed as doctors stormed a military hospital near the U.S. Embassy in Afghanistan's capital on Wednesday, killing at least 30 people and wounding more than 50.

The attack set off clashes with security forces that continued for hours, with some patients climbing out of the building and sheltering on window ledges.

Gen. Dawlat Waziri, a Defense Ministry spokesman, told NBC News that the militants killed 30 people — including soldiers, doctors and civilians.

He added that all four of the gunmen who entered the Sardar Mohammad Daud Khan Hospital had been killed.

The 400-bed military hospital is located in the Wazir Akbar Khan, Kabul's heavily-guarded diplomatic quarter.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

Following an explosion, the gunmen holed themselves up on the upper floors of the hospital and engaged special forces sent to the scene, officials said.

Afghan National Army soldiers descend from helicopter on a roof of the military hospital in Kabul on Wednesday. Mohammad Ismail / Reuters

Abdul Qadir, a hospital worker who witnessed the attack, told The Associated Press an attacker in a white coat shot at him and his colleagues.

ISIS later claimed responsibility for the attack in a tweet sent from an account they often use but offered no evidence to support their claim. ISIS has in the past claimed responsibility for attacks they weren't involved with.

Zabihullah Mujahid, a spokesman for the Taliban, tweeted that the militant group was not responsible for the attack.

Authorities initially put the death toll at 3 but revised the figure after security forces carried out checks of the buildings in the hospital complex.

President Ashraf Ghani condemned the attack during an address in honor of International Women's Day, calling it "an attack on all Afghan people and all Afghan women."

An Afghan man cries outside the military hospital in Kabul on Wednesday. Mohammad Ismail / Reuters

The hospital treats military casualties from around the country. It is located across the road from the heavily-fortified U.S. Embassy.

State Department acting spokesman Mark Toner said the U.S. strongly condemns the attack. "Targeting a medical facility that promotes care for brave Afghans working to protect their citizens has no possible justification," Toner said during a briefing with reporters.

A State Department official told NBC News there are no reports of U.S. citizens injured or killed in the attack.

The incident underlines warnings by government officials that high-profile attacks in Kabul are likely to escalate this year.

Afghan security forces have struggled to combat both the Taliban and ISIS since the U.S. and NATO formally concluded their combat mission at the end of 2014, switching to an advisory and counterterrorism role.