No one has claimed responsibility for the planned atrocity, but reports in the Middle East have said ISIS or one of its affiliates are thought to be behind it.

On Friday a suspect blew himself up in a house where he was hiding during a gunfight, and a further five were arrested by security services.

ISIS leader Abu Bakr al-Baghdadi – who Russia believes was killed in an airstrike in Syria last month – has previously called for attacks against Saudi Arabia, which has been battling the group alongside the US.

The terror group has previously been quick in claiming responsibility for attacks around the world.

The Interior Ministry added that the attack on the mosque was being planned by three terrorist groups, two based in Mecca and a third in Jeddah.

A statement released to state television stopped short of naming ISIS as the group behind it, but said the attack was planned to cause chaos.

It said: ‘They obeyed their evil and corrupt selves serving schemes managed from abroad whose aim is to destabilize the security and stability of this blessed country.

‘The security people, with the help of Almighty Allah, and then the unlimited support of the Custodian of the Two Holy Mosques and the Crown Prince, will be able to foil these criminal schemes and arrest those involved in them.’

Pictured: Saudi security forces on the ground after the shootout, during which a suspect blew himself up

Pictured: A still from a video broadcast on Saudi state television showing the evacuation of the wounded

The US Central Intelligence Agency said previous recent attacks in Saudi Arabia bore the hallmarks of ISIS.

Most of the targets in Saudi Arabia have been the Shiite minority and security forces, killing dozens of people.

The attack has been condemned by Saudi Arabia’s allies, with UAE Foreign Minister Sheikh Abdullah bin Zayed Al Nahyan stating: ‘This heinous crime exposes the extent of terrorism and the savagery of those terrorist groups, and no one in their right mind can justify or explain it.’

Two terror cells were identified in October after a plot to attack a World Cup qualifying match in Jeddah, and four Pakistani nationals were arrested.

And in July last three suicide attacks, in Medina, Jeddah and Qatif were attributed by the Saudi government to ISIS.

Five people, including a woman, were arrested in security operations in Mecca, Saudi Interior Ministry spokesman Mansour al-Turki said.