The trial is the first in recent memory in which Saudi citizens have been accused of spying.

A Saudi court on Tuesday sentenced 15 people to death for spying for the Iran, Saudi-owned media reported, in a ruling that could further stoke tension between the two rival powers.

The Specialised Criminal Court in Riyadh sentenced 15 other suspects to prison terms ranging from six months to 25 years, and acquitted two, the Arabic-language al-Riyadh newspaper said on its website.

The suspects, comprising 30 Saudi Muslims, one Iranian and an Afghan, were detained in 2013 on charges of spying for Iran and went on trial in February. The rulings are subject to appeal, and death sentences must go to the king for ratification.

The trial is the first in recent memory in which Saudi citizens have been accused of spying. It comes at a time of high tension between Saudi Arabia, and Iran over influence in the Middle East.

In January, Saudi Arabia executed a prominent cleric convicted of involvement in the killing of policemen, prompting protesters to storm the Saudi embassy in Tehran. Riyadh then broke off diplomatic tie

Many of the suspects are former employees of the Saudi defence and interior ministries, Saudi media said. They were accused of setting up a spy ring and passing sensitive military and security information to Iran, seeking to sabotage Saudi economic interests, undermining community cohesion and inciting sectarian strife.

The charges also included supporting protests in the region of Qatif in Eastern Province, recruiting others for espionage, sending encrypted reports to Iranian intelligence via email and committing high treason against the king.

Among those arrested in 2013 were an elderly university professor, a paediatrician, a banker and two clerics.