Saudi Arabia's king on Sunday vowed to punish those responsible for a rare suicide bombing that killed 21 people at a Shiite mosque in the country's east, calling it a "heinous terrorist attack" that runs against Islamic and human values.

King Salman made the pledge hours after the Interior Ministry confirmed that Friday's attack in the village of al-Qudeeh in the eastern Qatif region was the work of an Islamic State militant, backing up an earlier claim of responsibility by the group.

"Every participant, planner, supporter, collaborator or sympathizer with this heinous crime will be held accountable, tried and punished," King Salman said in a message addressed to Crown Prince Mohammed bin Nayef, who is deputy premier and minister of interior. "Our efforts will never stop ... fighting the deviant thought, confronting the terrorists and wiping out their hotbeds."

The Interior Ministry identified the bomber as Saudi citizen Saleh bin Abdulrahman al-Qashaami in a statement carried by the official Saudi Press Agency late Saturday.

Al-Qashaami was wanted for being an active member of an IS-linked terrorist cell, the ministry said. Lab tests showed that the explosive use in the bombing was a military-grade compound known as RDX.

The attack was the deadliest assault by militants in the kingdom since a 2004 Al Qaeda attack on foreign worker compounds.

Unlike that attack over a decade ago, Friday's strike targeted members of Saudi Arabia's Shiite minority -- a sect that both the Islamic State group and ultraconservatives in Saudi Arabia regularly denounce as heretics.

A statement from the ISIS group's al-Bayan radio station posted to militant websites Saturday said a new branch of the group was behind the attack, which it said was carried out by a Saudi going by the nom de guerre Abu Amer al-Najdi.

The ISIS group's activities are primarily focused on Iraq and Syria. Its claim of responsibility for Friday's strike and the official Saudi confirmation bolster concerns it has established a toehold inside the oil-rich kingdom, as it has done in Libya and Egypt's Sinai Peninsula.

It has warned of more "black days" for Shiites in Saudi Arabia, a member of the U.S.-led coalition targeting the group.

The Saudi Interior Ministry said the group also was responsible for the shooting death of a police officer in Riyadh earlier this month. It said five members of an ISIS cell killed Pvt. Majed Ayedh al-Ghamdi and burned his body. Authorities recovered guns, ammunition, explosives and other items from a farm linked to the militants, it said.