The Islamic State was responsible for the attack on an Afghanistan hospital’s maternity ward Tuesday that killed as many as 24—including new mothers and two newborns, according to the U.S. representative in the country.

Reuters reported that U.S. Special Representative Zalmay Khalilzad blamed the Islamic State for the attack on the hospital and another suicide bombing. ISIS claimed responsibility for the bombing, but not the hospital attack, which shocked the country already hardened by wars.

The attack on the Kabul hospital occurred at 10 a.m. when three militants stormed inside, shooting the women—many of whom were holding babies in their arms, the New York Times reported. Reports from inside Afghanistan claimed that the gunman dressed as police.

“The hospital was full of patients and doctors, there was total panic inside,” one witness told Al Jazeera.

Militants had stormed the hospital Tuesday, setting off an hours-long shootout with police. As the gunfight raged, Afghan security forces carried out babies and frantic mothers. The clinic in Dashti Barchi, a mostly Shiite neighborhood in Afghanistan’s capital, is supported by international aid group Doctors Without Borders.

One woman gave birth as the shooting was taking place, the aid group said in a statement Wednesday. It said the woman and her baby were doing well.

Deborah Lyons, the head of the U.N. mission in Afghanistan, reportedly tweeted, “Who does this?  The most innocent of innocents, a baby! Why? Cruelty has no followers from humanity.”

Al Jazeera reported that photos from inside the hospital showed chilling images, including one of a dead mother still holding her baby, who survived.

"The unconscionable war crimes in Afghanistan today, targeting a maternity hospital and a funeral, must awaken the world to the horrors civilians continue to face," Amnesty International tweeted.

GET THE FOX NEWS APP

The Taliban insisted they were not involved. The Taliban and Islamic State extremists are rivals. Afghan and American officials say the Islamic State affiliate in Afghanistan has been weakened in recent months as a result of U.S. bombing raids in the group’s stronghold, the eastern Nangarhar province, as well as military operations by Afghan security forces and attacks by Taliban insurgents.

The Associated Press contributed to this report