At least 27 people have been killed in a suspected suicide attack at a mosque in the Afghan capital, according to officials in Kabul.

An estimated 35 people were also injured but survived after the blast during the Baqirul Olum mosque ceremony in the west of the city on Monday.

Worshippers were marking the Shia ceremony of Arbaeen, which commemorates the assassinated grandson of the Prophet Muhammad, and which comes 40 days after the major Ashura festival.

Senior police official Fridon Obaidi said: "It was a suicide bomber who blew himself up among worshippers inside the mosque, killing 27 and wounding 35."

Earlier this year, a powerful blast targeting Shia muslims during Ashura killed 14 people in northern Afghanistan.

Witness Ali Jan said: "I was in the mosque, the people were offering prayers.

"Suddenly I heard a bang and windows broke. I had no idea what had happened. I rushed out screaming."

No invidual or organisation has yet claimed responsibility for Monday's attack.

The Taliban, seeking to reimpose Islamic law after their 2001 ouster, denied they were responsible.

"We have never attacked mosques as it's not our agenda," said the movement's main spokesman, Zabihullah Mujahid.

Bloody sectarian rivalry between Sunni and Shia Muslims has been relatively rare in Afghanistan, which is a majority Sunni country.

Government chief executive Abdullah Abdullah condemned the attack as a sign of barbarism but said Afghanistan should not fall victim to "enemy plots that divide us by titles".

"This attack targeted innocent civilians - including children - in a holy place. It is a war crime & an act against Islam & humanity," he said in a message on his Twitter account.

Shia muslims make up around 15 per cent of the population in Afghanistan. An attack in July, claimed by Daesh, killed 80 people at a Shia protest march in Kabul.