Numerous shoes belonging to the victims lie unclaimed in a pile at the entrance to the mosque (AFP Photo/SHAH MARAI)

Four attackers setting off explosions and firing gunshots laid siege to the Emam Zaman mosque in the north of Afghanistan's capital for four hours as dozens of men, women, and children gathered for Friday prayers (AFP Photo/SHAH MARAI)

Distraught relatives and friends carried coffins into the cemetery one by one, a day after the latest deadly attack claimed by the Islamic State group on Afghanistan's reeling minority Shiite community (AFP Photo/SHAH MARAI)

Hundreds of Shiite mourners on Saturday buried victims of a suicide bomb and gun attack on a mosque in Kabul as the death toll from the atrocity rose to 28.

Distraught relatives and friends carried coffins into the cemetery one by one, a day after the latest deadly attack claimed by the Islamic State group on Afghanistan's reeling minority Shiite community.

Four attackers setting off explosions and firing gunshots laid siege to the Emam Zaman mosque in the north of Afghanistan's capital for four hours as dozens of men, women, and children gathered for Friday prayers.

Some 50 people were also wounded in the attack which again underlined Afghanistan's deteriorating security situation while more than 100 worshippers were rescued when security forces stormed the building.

In scenes that have become all too depressingly familiar for Shiites in the war-torn country recently, wailing mourners gathered at the mosque Saturday to lay the bodies of the dead side by side in graves.

"We used to attend ceremonies such as Ashura together in this mosque, but today I am burying their bodies here," Hussain Ali, who lost a friend in the attack, told AFP.

"This is not the first time, it keeps happening. The government has failed to provide us security. Even today in this ceremony people are worried lest something will happen," he added.

Numerous shoes belonging to the victims lay unclaimed in a pile at the entrance to the mosque as police stood guard outside.

Inside, blood-stained women's veils could be seen alongside charred copies of the Koran and prayer mats.

IS claimed the deadly assault through its propaganda outlet Amaq.

Shiites, a minority of around three million in overwhelmingly Sunni Afghanistan, have regularly been targeted by IS jihadists over the past year, providing a sectarian twist to years of conflict in the war-weary country.

They accuse security forces of not doing enough to protect them.

Earlier this month 33 worshippers were killed and 66 wounded in a suicide attack claimed by IS on a Shiite mosque in the western Afghan city of Herat.

Twin explosions in July 2016 ripped through crowds of Shiite Hazaras, killing at least 85 people and wounding more than 400.

The burials came as an official said the death toll from Friday's attack had increased from 20 to 28.

"The latest death toll from Kabul hospitals is 28 killed, including three women, and around 50 wounded, including over a dozen women and children," Mohammad Ismail Kawoosi, a health ministry spokesman, told AFP.

The Afghanistan Independent Human Rights Commission condemned the attack as "inhuman" and "un-Islamic" in a statement.

It also said it was "against international human rights and laws" and called for militants to stop attacking religious sites and civilians.