A suicide bomber detonated himself at the gate of a mosque in the Afghan capital as other attackers stormed the building, killing at least 14 people as worshippers gathered for Friday prayers, officials said.
There was no immediate claim of responsibility, but Daesh militants have attacked targets in Afghanistan in the past.
An official at the Ministry of Interior said there were at least 14 civilian casualties, while at least two policemen had been killed and eight wounded.
At least two bodies and 15 wounded people had been brought to city hospitals, with ambulances retrieving more casualties at the scene, said Ismail Kawosi, a spokesman for the Ministry of Public Health.
Some witnesses at the scene said the attackers threw grenades, while police officials said a suicide bomber detonated himself at the gate.