Saudi Arabia says it has thwarted a terrorist attack by a Pakistani resident who was planning to bomb a mosque during sunset prayers in the predominantly Shiite eastern governorate of Qatif.

An Interior Ministry statement released Wednesday says police questioned the man the day before and discovered he was carrying a bomb inside a sports bag. The statement says police fired on the suspect during the encounter and that he died while being transported to the hospital, without providing further details.

In July, Saudi Arabia identified a Pakistani man as being behind a suicide bombing outside the U.S. Consulate in the western city of Jiddah. Police later arrested 12 Pakistanis in connection with that attack and two others that took place in Qatif and Medina.