Saudi Arabia has arrested 431 people suspected of belonging to Islamic State of Iraq and the Levant (ISIL) cells, and thwarted suicide attacks on mosques, security forces and a diplomatic mission, the interior ministry has said.

In a statement on Saturday carried on the official state news agency, the interior ministry accused those arrested over the "past few weeks" of conducting several attacks, including an ISIL-claimed suicide bombing in May that killed 21 people in the village of al-Qudeeh, in the oil-rich eastern Qatif region. It was the deadliest assault in the kingdom in more than a decade.

The statement said most of the 431 suspects were Saudi nationals, but also included other nationals from the Middle East and Africa.

The report said authorities also stopped six successive suicide operations, which targeted mosques in the Eastern province, and timed with assassinations of security men.

Related: How is ISIL expanding?

"Terrorist plots to target a diplomatic mission, security and government facilities in Sharurah province and the assassination of security men were thwarted," it said.

Senior interior ministry official Bassam Attiyah said the suspects belong to several "cluster cells" who were operating separately from each other.

"They are aiming to spread terrorism in Saudi Arabia, and they wish to create chaos and rift in the country."

Attiyah also said that the suspects used social media to operate and recruit members.

ISIL claims responsibility for Saudi mosque attack

Shia mosque attack

The interior ministry also blamed the suspects for the November shooting and killing of eight worshippers in the eastern Saudi village of al-Ahsa.

The statement said the arrested men were also behind another attack in late May, when a suicide bomber disguised as a woman blew himself up in the parking lot of a Shia mosque during Friday prayers, killing four people.

The ministry said that in June they thwarted a suicide bomb attack on a large mosque in eastern Saudi Arabia that can hold 3,000 worshippers.

Saudi Arabia has taken several steps to stop its citizens joining fighters in Syria or Iraq, with the country's highest religious authority condeming the armed group as "apostates" and labelling them the "number one enemy of Islam".

In an interview with Al Jazeera, Jamal Khashoggi, editor-in-chief of the Al Arab news channel, said that while the arrests were "good news", they also showed how ISIL is able to recruit new members in the country.

He said that unless the "chaos" in neighbouring Iraq and Syria are addressed, the "frenzy of recruitment" will continue.

ISIL, which according to reports has recruited thousands of foreign fighters, still controls large parts of Syria and Iraq, where it has been accused of committing mass atrocities against civilians and minority groups.

Saudi nationals have been blamed for several suicide attacks within the country and abroad in recent months.

The main suspect in the deadly suicide bombing at a Shia mosque in Kuwait was identified as a Saudi national.