The attacker entered the Baqir ul Olum mosque during a ceremony, the interior ministry said in a statement.
This Muharram, remember the lives lost to terror
Fraidoon Obaidi, chief of the Kabul police Criminal Investigation Department, said at least 27 people were killed and 35 wounded and that the total may rise.
"I saw people screaming and covered in blood," a survivor told Afghanistan's Ariana Television. He said around 40 dead and 80 wounded had been taken from the building before rescue services arrived at the scene, but there was no independent confirmation of those figures.
The Taliban, seeking to reimpose Islamic law after their 2001 ouster, denied they were responsible for the attack. "We have never attacked mosques as it's not our agenda," said the movement's main spokesperson, Zabihullah Mujahid.
Bloody sectarian rivalry between Sunni and Shi'ite Muslims has been relatively rare in Afghanistan, a majority Sunni country, but the attack underlines the deadly new dimension that growing ethnic tension could bring to its decades-long conflict.
14 killed as gunmen target Shias marking Ashura in Kabul
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.
In July, more than 80 people were killed in an attack on a demonstration by the mainly Shia Hazara minority that was claimed by Islamic State militants.
COMMENTS (1)
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ