Saudi Arabia Iran tensions
Flames rise from Saudi Arabia's embassy after it was stormed by Iranian protesters during a demonstration in Tehran, Jan. 2, 2016. REUTERS/TIMA/Mehdi Ghasemi/ISNA

A court in Saudi Arabia handed down death sentences to 15 people Tuesday for spying for Iran, according to reports. Fifteen other suspects were sentenced to jail terms ranging from six months to 25 years while two were acquitted.

The suspects comprised 30 Saudi Shia Muslims, one Iranian and an Afghan. They were detained in 2013 over espionage charges and stood trial in February. Prosecutors accused the suspects of forming a spy ring in collaboration with Iranian intelligence, and handing over classified information on Saudi military zones. The sentences can be appealed.

An elderly university professor, a pediatrician, a banker and two clerics were among those arrested in 2013. Most of the suspects hailed from al-Ahsa, a region in eastern Saudi Arabia home to both Shias and Sunnis.

Sunni-majority Saudi Arabia and Shia Iran are regional rivals with a long and troubled history. The Shia community, which reportedly makes up about 10 to 15 percent of Saudi Arabia's population, alleges constant discrimination by Saudi officials. However, Riyadh has denied these allegations.

In January, the kingdom cut diplomatic relations with Iran after the Saudi embassy in Tehran was attacked over the execution of the prominent Saudi Shia cleric, Sheikh Nimr al-Nimr, and three other Shias. Saudi Arabia has maintained that Nimr was among 46 others who were accused of being terrorists or inciting violence against the Saudi royal family.

Nimr was a well-known critic of the Saudi regime and his execution further soured relations between Sunni and Shia Muslims in the region. Elsewhere in the Middle East, both Iran and Saudi Arabia are involved in a proxy war in Yemen, with the former supporting Houthi rebels looking to overthrow the existing regime supported by Saudi Arabia.