The suspected bomber tried to enter the mosque but was blocked by police, setting off a gun battle, Interior Ministry spokesman Najib Danish said.
The attacker then took refuge in a kitchen before detonating a bomb. The attack came as mosques around the city were crowded for a night of religious observances as part of the Islamic holy month of Ramazan.
Massive Kabul truck bomb kills 90, wounds hundreds
The al Zahra mosque is used by Kabul's Shia minority, who have been targeted by suicide bombings in the past.
An attack on a Shia mosque in November killed more than 30 people. Islamic State militants claimed responsibility for that attack, as well as an attack last July that killed more than 80 people at a mostly Shia demonstration.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ