In a separate attack the same day, a suicide bomber struck the funeral of a police commander, attended by government officials and a member of parliament, in the eastern province of Nangahar, killing at least 24 people and injuring 68. Authorities said that toll could rise.
There was no immediate claim of responsibility for either attack. The Taliban, Afghanistan’s main Islamist insurgency group which says it has halted attacks on cities under a US troop withdrawal deal, denied involvement in both.
The Islamic State militant group operates in Nangahar and has carried out a number of high-profile attacks in Kabul in recent months. On Monday security forces arrested its regional leader in the capital.
The violence, as the country battles the coronavirus pandemic, risks derailing momentum towards US-brokered peace talks between the Taliban and an Afghan government long sceptical of the insurgents’ renunciation of attacks.
Photos from the Ministry of Interior showed two young children lying dead inside the hospital. An image showed a woman who had been killed lying on the ground still holding tightly to her baby, who a nurse in the unit confirmed had survived and had been moved to an intensive care unit at another hospital.

An Afghan security officer carries a baby (AAP) Source: AP
President Ashraf Ghani, in a televised address, condemned the attacks and said he had ordered the military to switch to ‘offensive’ mode rather than the defensive stance it had adopted as the United States withdraws troops and tries to broker the talks.
“In order to provide security for public places and to thwart attacks and threats from the Taliban and other terrorist groups, I am ordering Afghan security forces to switch from an active defence mode to an offensive one and to start their operations against the enemies,” he said.

An Afghan policeman comforts a man (AAP) Source: AP
Meanwhile National Security Advisor Hamdullah Mohib said on Twitter: “there seems little point in continuing to engage Taliban in peace talks”.
In Washington, the Pentagon declined to comment on mR Ghani’s stated intent to restart offensive operations, saying only that the US military continued to reserve the right to defend Afghan security forces if they are attacked by the Taliban.
“This is going to be a windy, bumpy road, but a political agreement is the best way to end the war,” Pentagon spokesman Army Lieutenant Colonel Thomas Campbell said.
Mothers, children, nurses
The Kabul attack began in the morning when at least three gunmen wearing police uniforms entered the Dasht-e-Barchi hospital, throwing grenades and shooting, government officials said.
Security forces had killed the attackers by the afternoon.
“The attackers were shooting at anyone in this hospital without any reason. It’s a government hospital, and a lot of people bring in their women and children for treatment,” Ramazan Ali, a nearby vendor who saw the start of the attack, said.
The 100-bed government-run hospital hosted a maternity clinic run by Doctors Without Borders, also known by its French name Médecins Sans Frontières.
MSF confirmed in a tweet that the hospital had been attacked.
Just hours before it had tweeted a photo of a newborn at the clinic in his mother’s arms after being delivered safely by emergency caesarean section.
Interior and health ministry officials said that mothers, nurses and children were among the dead and wounded.

A view of bullet ridden window and walls of the MSF hospital (AAP) Source: EPA
Soldiers ferried infants out of the compound, some wrapped in blood-stained blankets, and officials said 100 people were rescued, including three foreigners.
The neighbourhood is home to many members of Afghanistan’s Hazara community, a mostly Shia Muslim minority that has been attacked by Sunni militants from Islamic State in the past, including at a Kabul ceremony commemorating the death of one of its leaders in March.
Rights group Amnesty International condemned both attacks.
“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,” the group tweeted.
“There must be accountability for these grave crimes."