A gunman opened fire at a Shiite gathering hall in eastern Saudi Arabia Friday, killing five people and injuring nine before being shot dead by police, the Saudi interior ministry said. A group claiming links to the Islamic State group, also known as ISIS, took responsibility for the attack.

The attack reportedly occurred in the Saudi city of Saihat in Eastern Province just two days ahead of the start of Ashura commemorations, a holly occasion for Shiite Muslims. Authorities reportedly said a gunman randomly opened fire at people before police intervened.

"A person who opened fire on a husseiniya was killed, and the attacker was in his twenties," government-run channel Al Ekhbariya TV reported, according to Reuters.

Later, a group calling itself the Islamic State-Bahrain State -- a previously unheard of branch of ISIS -- said one of its "soldiers" had carried out the attack. The group warned that "infidels will not be safe in the island of Mohammed,” according to BBC.

"With the approval of God Almighty, the soldier of the caliphate Shuja al-Dawsari, may God accept him, set his Kalashnikov upon one of the apostate polytheists' temples," an online statement on one of the Twitter accounts used by ISIS read, according to Reuters.

State media also confirmed that ISIS, a Sunni militant group based in Iraq and Syria, was behind the attack.

During Ashura last year, ISIS-linked gunmen reportedly killed seven Shiite worshippers, including children, in the eastern town of Al-Dalwa.