RIYADH  - A Saudi court Tuesday sentenced 15 people to death for spying for the kingdom's rival Iran, local media and a source close to the case said, in a move likely to heighten regional tensions.

The source told AFP that most of the 15 Saudis were members of the kingdom's Shiite minority. Their trial opened in February, a month after Riyadh cut diplomatic ties with Tehran over the burning of the Saudi embassy and a consulate by Iranian demonstrators protesting the kingdom's execution of Shiite cleric Nimr al-Nimr.

The most serious charge levelled against them was high treason.

Prosecutors also alleged the accused had divulged defence secrets, tried to commit sabotage, to recruit moles in government departments, to send coded information, and supported "riots" in the Shiite-dominated eastern district of Qatif, Saudi media reported. The 15 were among a group of 32 people tried over the espionage allegations, Alriyadh newspaper said on its website.  Some of the defendants were accused of meeting Iran's supreme leader Ayatollah Ali Khamenei. The death sentences will be appealed, said the source close to the case, who cannot be identified due to its sensitivity.

Two of the group were acquitted while the rest received jail sentences of between six months and 25 years.

Apart from one Iranian and an Afghan, all of the defendants were Saudis. The source said that one of the two acquitted was a foreigner. Adam Coogle, a Middle East researcher for New York-based Human Rights Watch (HRW), told AFP that the trial was "flawed from the beginning."

It was tainted by allegations that the accused did not have access to lawyers during interrogation, Coogle said. They were also charged with offences that do not resemble recognisable crimes, including "supporting demonstrations," attempting to "spread the Shia confession," and "harming the reputation of the kingdom," he said.

"Criminal trials should not be merely legal 'window-dressing' where the verdict has been decided beforehand," he said.

HRW earlier cited a lawyer who represented some of the accused until March as saying the timing of the case "may relate to ongoing hostility between Iran and Saudi Arabia".

All but one of the accused had been detained since 2013.