Saudi Arabia has arrested four people suspected of being the key figures behind an attack on Shia Muslims earlier this month, a security official said, adding that the attacks are believed to have been ordered by Islamic State in Iraq and Levant.

Seven members of the Shia minority were shot dead in the Eastern Province district of al-Ahsa on November 3 as they gathered to commemorate Ashura.

Saudi Arabia put down an upsurge by armed groups a decade ago, but fear is building over the possibility of fighters from ISIL or al-Qaeda affiliate Nusra Front, now operating in Syria or Iraq, radicalising Saudis to mount a new wave of strikes inside the Sunni kingdom.

Last week, the ministry said fighters were trying to attack Saudi Arabia, but that it was not aware of any evidence that the al-Ahsa attack had been coordinated with ISIL.

On Monday, the official news agency cited an Interior Ministry security spokesman as saying that 77 suspects had been arrested so far, and that they were believed to include the four main perpetrators.

He said the leader of the al-Ahsa attack had received orders from abroad, and that "the target, as well as those to be targeted and the timing were all specified for him, as well as the provision that the (attack) be carried out in al-Ahsa".

The leader had picked three followers, and those had scouted out the target, seized a car, killed its owner, and used it in the attack.

The spokesman said security forces carried out operations "to arrest everyone affiliated with this terrorist group, whether those who pledged allegiance to the leader of the group, or participants, supporters, financiers, or those who provide cover".

Two Saudis and a Qatari were killed as they resisted arrest, along with two security officers, the ministry said.

Authorities had already said that among the detainees were people believed to have fought for Sunni armed groups in Syria or who had previously been jailed for fighting for al-Qaeda.

As the birthplace of Islam and a champion of Sunni doctrine, Saudi Arabia is an important ally for Western countries battling ISIL, and its monarchy a symbolic target for the armed group itself.

Although it has backed rebel groups fighting alongside jihadis against Syrian President Bashar al-Assad, Saudi Arabia has also taken steps to stop its citizens joining fighters in Syria or Iraq, or giving them money.