The blast happened in the Serahi Alauddin district, Afghan private broadcaster TOLO News reported, citing an eyewitness.
Emergency, an NGO that offers free medical and surgical treatment to Afghan civilians, said in a tweet that 20 people wounded in the blast were being treated at their hospital.
At least two UN staff and their families were inside the Khalifa Sahib Mosque at the time of the attack, the UN deputy spokesman for the secretary-general said on Friday.
Farhan Haq said he “strongly condemned” the attack, calling it “the latest in a series of indiscriminate attacks on civilian targets.”
In a statement released on Twitter on Friday, Taliban spokesman Zabihullah Mujahid also said said he condemned the attack, which took place days before the end of Ramadan.
“We condemn in the strongest terms today’s explosion at a mosque in Kabul’s sixth district. Such brutal killings during this fast are the work of circles that have nothing to do with Islam or the country,” Mujahid tweeted on Friday.
“The Islamic Emirate expresses its deepest condolences to the families of the victims. The perpetrators of these crimes will soon be found and punished, God willing,” he added.
Weeks of deadly attacks
A series of deadly blasts, mostly targeting the Hazara Shia community, have rocked several Afghan cities over the past two weeks.
Last week, an explosion at a mosque in Kunduz province, Afghanistan, killed 33 people and wounded dozens during Friday prayers, according to Taliban spokesman Mujahid.
That blast was followed by other attacks in the previous days – one in the northern Afghanistan city of Mazar-i-Sharif and another in Kunduz, along with several blasts earlier in the week at a high school and education center in western Kabul.
Most of the recent attacks have been claimed by the ISIS affiliate and Taliban rival ISIS-Khorsan (ISIS-K). Friday’s explosion has yet to be claimed by any group.
CNN’s Mostafa Salem, Nicola Careem and Hannah Ritchie contributed to this report.