The three suspected attackers tried to enter the Al Zahra mosque, used by Kabul's Shi'ite minority, but were blocked by police, setting off a gun battle, ministry spokesman Najib Danish said.
The attackers then took refuge in a kitchen, where one detonated a bomb while the other two were killed by security forces, he said.