Militants disguised as doctors have killed more than 30 people in an attack on a military hospital near the US embassy in Kabul with bombs, grenades and guns.

Isis claimed responsibility for the assault on the Sardar Mohammad Daud Khan hospital as battles between jihadis and security forces continued on Wednesday, leaving at least 50 wounded.

The terrorist group, which is competing with the Taliban in Afghanistan, claimed its “commandos” had killed more than 100 people at the 400-bed facility for wounded soldiers.

Photos apparently taken by one of the militants showed him wearing a surgical mask and suit, while armed with a gun and machete.

An Isis propaganda image claiming to show one of the militants who attacked a military hospital in Kabul on 8 March

Isis published a graphic image claiming to show the bodies of three medical staff lying on the hospital floor on its Amaq propaganda channel.

A suicide bomber blew himself up at the rear of the complex before three gunmen armed with automatic rifles and hand grenades entered through the breach.

The gunmen, dressed as medical personnel, had taken position on upper floors of the hospital and engaged special forces sent to the scene, officials said.

A worker at the hospital told Reuters he saw one gunman dressed in a white doctor's coat take out a concealed AK-47 and open fire, killing at least one patient and one hospital worker.

Abdul Qadir also heard firing from several other parts of the hospital, which treats military casualties from around Afghanistan.

Security forces blocked off the area around the hospital, which sits near a busy road junction in the Afghan capital, and a second explosion was heard during battles.

War artists in Afghanistan Show all 6 1 /6 War artists in Afghanistan War artists in Afghanistan Work by Matthew Cook Matthew Cook War artists in Afghanistan War artists in Afghanistan Work by Jules George Jules George War artists in Afghanistan Embedded: Jules George War artists in Afghanistan Work by Jules George Jules George War artists in Afghanistan Trooping the colours: Jules George was inspired by his father and grandfather to witness and document war, if not to wage it Jules George

General Dawlat Waziri, a spokesperson for the Afghan defence ministry, said government troops had taken full control of the facility after several hours of fighting.

He said there “more than 30 killed and more than 50 wounded” at the hospital, which is the largest military clinic in Afghanistan.

It lies across the road from the heavily fortified US embassy and around the corner from the Afghan Supreme Court, emphasising warnings by government officials that high-profile attacks in Kabul are likely to escalate this year.

President Ashraf Ghani confirmed the assault during a speech to mark International Women’s Day, saying: “There is an ongoing terrorist attack in a hospital which tramples all human values.

"In all religions, a hospital is regarded as an immune site and attacking it is attacking the whole of Afghanistan."

The Nato-led Resolute Support mission said it was ready to assist Afghan security services.

A spokesperson for the US embassy condemned the attack, saying it demonstrated a "blatant disregard for human life by those seeking to disrupt Afghanistan’s democratic progress".

Smoke billows from the Sardar Daud Khan's Hospital during an attack in Kabul, Afghanistan, on 8 March (EPA)

"Targeting a medical facility providing care for the brave Afghans working to protect their fellow citizens has no possible justification in any religion or creed," a spokesperson added.

"We extend our deepest heartfelt condolences to the families, friends, and colleagues of the victims of this senseless and cowardly act."

Afghanistan has been hit by a wave of terror attacks in recent months as Isis competes with the Taliban and al-Qaeda in a continuing Islamist insurgency in the country.

Last week saw dozens killed and wounded in coordinated attacks on a police station and an office of the intelligence service in Kabul.

That attack was claimed by the Taliban, who are seeking to expel foreign troops, defeat the US-backed government and reimpose Sharia law under their “Islamic Emirate” after being ousted from Kabul in 2001.

Dozens have been killed in recent days in fighting across Afghanistan, from Kunduz and Baghlan in the north to Farah in the southwest and Helmand and Kandahar on the Pakistan border, as the Taliban’s insurgency continued.

In February, Isis gunmen massacred six Red Cross workers and the group also claimed responsibility for a suicide bombing struck the entrance to the Afghan Supreme Court in Kabul, killing at least 20 people and wounding more than 40 more.