A suicide bomber killed at least three people and wounded five more in an attack at mosque here on Thursday, security officials said.

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 Ramzan.

The Al Zahra mosque, which was attacked, is used by Kabul’s Shia minority, who have been targeted by suicide bombings in the past. An attack on a Shia mosque last November killed more than 30 people.