Militants stormed a maternity hospital in Kabul, sparking an hours-long shootout with police and killing 16 people, including two newborn babies, their mothers and a number of nurses, Afghan officials said.
While the battle was under way, Afghan security forces struggled to evacuate the facility, carrying out babies and frantic young mothers, according to images shared by the Interior Ministry.
Soon after the attack started, black smoke rose into the sky over the hospital in Dashti Barchi, a mostly Shiite neighbourhood that has been the site of many past attacks by IS militants.
Interior Ministry spokesman Tareq Arian said more than 100 women and babies were evacuated from the building before it was over.
Mr Arian said 15 others, including women, men and children, were wounded in the attack.
Three foreign nationals were among those safely evacuated, he said.
It was unclear why the maternity hospital in Dashti Barchi, a 100-bed facility, was targeted – an attack Mr Arian said was an "act against humanity and a war crime".
No-one immediately claimed responsibility for the attack in Kabul, where both the Taliban and the IS frequently target Afghan military and security forces, as well as civilians.
The Taliban denied they were involved.
The day's spasm of violence extended beyond Kabul.
A suicide bomber in eastern Nangarhar province – a hotbed of so-called Islamic State – targeted a funeral ceremony, killing 24 people and wounding 68.
In eastern Khost province, a bomb planted in a cart in a market killed a child and wounded 10 people.
The violence could further undermine a peace process in the wake of a deal signed between the United States and the Taliban in February, which envisages the start of talks among key Afghan figures, including government representatives, and the Taliban.
In a televised speech hours after the attacks, Afghan President Ashraf Ghani announced that Afghan security forces would no longer operate in the defensive posture taken in the wake of the peace agreement.
Instead, he called on security forces to launch attacks against Taliban insurgents.
"The Taliban have not given up fighting and killing Afghans, instead they have increased their attacks on our countrymen and public places" despite repeated calls for a ceasefire, Mr Ghani said.
Photos shared by the Interior Ministry during the Kabul attack show newborn babies and their mothers being carried out of the hospital by Afghan security forces.
"The forces are trying to eliminate the terrorists and bring the situation under control," said Mr Arian while the battle was ongoing.
By mid-afternoon, the ministry issued a statement saying three attackers had stormed the hospital and that one was shot and killed while the other two were still resisting arrest.
The first floor of the clinic was cleared but the operation was ongoing to secure the rest of the building, the statement said.
A few hours later, the ministry released another statement, saying all three attackers were dead and that the operation was over.
In the evening hours, husbands, fathers and family members of the hospital's patients gathered around the site in Dashti Barchi, desperate for news of their loved ones.
A man read out the names of those who had been evacuated to other hospitals.