Two babies and 11 mothers and nurses have been killed in an attack on a hospital in the Afghan capital.

Another 15 people, including a number of children, were injured when several gunmen attacked the Kabul hospital on Tuesday morning, officials said.

Part of the hospital is run by the international medical charity, Medicins Sans Frontieres (MSF), and some of those working there are foreigners.

Meanwhile, in the east, an attack at a police funeral has killed at least 24.

Dozens more were injured in that bomb blast and casualty numbers in both attacks could rise.

It is not clear who carried out either attack.

In Kabul, locals heard two blasts, then gunfire. One doctor who fled during the assault, which began at about 10:00 local time (05:30 GMT), said about 140 people were in the hospital when the gunmen began their attack.

Afghan special forces have rescued 100 women and children, including three foreigners, an official told the BBC.

The attackers, who gained access dressed as police officers, according to news agency Reuters, were all killed by security personnel after a battle lasting hours.

Images from the scene of the attack showed soldiers carrying one newborn baby to safety, swaddled in a blood-stained blanket.

It is not clear if the infant had been injured.

The Dasht-e-Barchi Hospital has a maternity wing run by MSF.

Many foreign staff live in a guesthouse behind the hospital building and a doctor who fled the building said he saw an explosion there too.

The Taliban, who signed a withdrawal agreement with the United States more than two months ago, have denied involvement.

In the past, similar attacks on foreign and other civilians in this mostly Shia area of the capital have been attributed to the Islamic State (IS) militant group, which has not yet issued a statement.

The group’s leader in South Asia and the Far East was arrested in Kabul on Tuesday, with two other high profile members, Afghan intelligence said.

In 2017, IS gunmen disguised as medical staff attacked Kabul’s main military hospital, prompting widespread shock and anger and raising questions about security.

The authorities later confirmed about 50 people had been killed.

But the Taliban also attack hospitals.

Last September, 20 people died after a truck packed with explosives was detonated by militants from the group outside a hospital in southern Zabul province.

In the eastern province of Nangarhar, a member of the provincial council was among those killed in the attack on Tuesday on the funeral procession of a local police commander.

According to survivors, thousands of people had gathered for the funeral. The bomb detonated about half-way through.

Ataullah Khogyani, a spokesman for the governor, said another 68 people were injured.

Zabat Amir Mohammad, a former member of the Nangarhar provincial council, told local news outlet Sharq TV that “it was difficult to identify” the bodies among the wounded and killed.

The Taliban have denied carrying out the attack, although it remains unclear who was behind it and the group have denied responsibility in the past for attacks they are accused of.

In northern Balkh province, at least 10 people have been killed and as many others injured in an air strike by US forces, reports say.

Local residents and the Taliban claim the victims were all civilians. But the Afghan Defence Ministry said all those killed were militants.

Since the February peace deal, talks have broken down over a prisoner swap agreed between the US and the Taliban and violence has continued unabated.

IS were not part of the negotiations.

The agreement was aimed at ending more than 18 years of war since US-led forces ousted the Taliban from power following the 9/11 attacks on the US, whose mastermind Osama Bin Laden had been given sanctuary by the hardline Islamist group.

Tens of thousands of people, most of them civilians, have been killed in the conflict.

Many more have been injured or displaced from their homes.