The attack took place in the Khair Khana neighborhood of the city during evening prayers on Wednesday, reports said.
Italian non-governmental organization (NGO) Emergency, which operates a hospital in Kabul, said it had received 27 victims, including three fatalities.
"We have recorded three fatalities," Emergency told AFP via email.
"Most of the patients we received following the explosion inside a mosque are suffering from shell and burn injuries," the NGO added.
The hospital noted in a tweet that the wounded included five children, one of them a 7-year-old.
Tolo News, Afghanistan's leading private news channel, quoted Kabul police spokesman Khalid Zadran confirming that the blast occurred in police district (PD) 17 of Kabul.
He said security forces have arrived in the area, without giving more details.
A Twitter user claimed that today's attack killed among others a religious cleric, Amir Mohammad Kabuli, but the news has not been confirmed by the Taliban.
The user said Kabuli was a Sufi scholar and that the Daesh terrorist group was most likely behind the attack.
No group has so far claimed responsibility for the attack, but local sources say it could be the handiwork of the Daesh Takfiri terrorist group that has carried out many such attacks in recent months.
Last week a prominent pro-Taliban cleric was killed in a suicide blast in Kabul. The Daesh terrorist group claimed responsibility for the attack.
The attack comes two days after the first anniversary of the US withdrawal and the Taliban’s comeback in the war-ravaged country.