Gunman shot dead, with ISIL affiliate claiming responsibility for attack that left five dead and nine wounded in Qatif.

A gunman has shot dead five people at a Shia gathering in eastern Saudi Arabia before police shot him dead, the interior ministry said.

A group claiming affiliation with the Islamic State of Iraq and the Levant said it carried out the attack on Friday.

“As a result of his shooting, five citizens … were killed, including a woman. Nine others were wounded,” an interior ministry spokesman said in a statement.

He said that at about 7pm (16:00 GMT) on Friday, a suspect with an automatic weapon “started to shoot randomly” at al-Haidaria hussainiya in the Saihat area of Qatif city.

Police intervened and opened fire, killing the suspect, the spokesman said without giving details about the attacker.

“The situation is still under investigation,” he said.

The Saudi Press Agency added the suspected gunman was in his 20s and that “authorities believe that he is mentally challenged”.

A group calling itself Islamic State-Bahrain State said in a statement that one of its “soldiers”, Shughaa al-Dosari, “attacked a Shia infidel temple with an automatic weapon” in Saihat.

The group posted a picture of the alleged attacker and warned that “infidels will not be safe in the island of Muhammad”.

In May 2015, ISIL claimed responsibility for a suicide bombing during midday prayers at a Shia mosque in eastern Saudi Arabia. The Saudi health ministry said at least 21 people had been killed and more than 120 others injured.

Another suicide bomber killed at least 15 people in an attack on a mosque used by members of a local security force in southwest Saudi Arabia in August.