A Saudi court 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.
Tehran swiftly denied the espionage charges and urged Saudi Arabia not to "seek to bring baseless accusations against Iran with the intention of political gains and increasing tensions in the region."
The espionage 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 against the kingdom's execution of Shiite cleric Nimr al-Nimr.
The most serious charge levelled against the accused was high treason.
Prosecutors also alleged the accused had divulged defence secrets, tried to commit sabotage and 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.
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 the defendants were Saudis. The source said that one of those acquitted was a foreigner.
Iran's foreign ministry spokesman Bahram Ghasemi said Riyadh had not passed on "any information to the Islamic Republic of Iran regarding the alleged Iranian person" in the trial.
Amnesty International, in a statement, called Tuesday's sentence "a travesty of justice and a serious violation of human rights".
"Sentencing 15 people to death after a farcical trial which flouted basic fair trial standards is a slap in the face for justice," said Amnesty's Samah Hadid.
- Syria, Yemen tensions -
Adam Coogle, a Middle East researcher for 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.
The region's leading Shiite and Sunni powers are at odds over a range of issues including the wars in Syria and Yemen.
Saudi Arabia has also expressed concern over an international agreement that lifted sanctions on Iran in exchange for guarantees it would not pursue a nuclear weapons capability.
Riyadh fears the pact will lead to more Iranian "interference" in the region.
With relations at a low, Iranian pilgrims in September -- for the first time in nearly three decades -- did not attend the annual hajj in Saudi Arabia after the two countries failed to agree on security and logistics.
Nimr, the executed cleric whose case sent tensions soaring, was a driving force behind protests that began in 2011 among the Shiite minority, most of whom live in the kingdom's east which faces Iran across the Gulf.
The protests developed into a call for equality in the Sunni-dominated kingdom, where Shiites have long complained of marginalisation.
Nimr was convicted of terrorism and executed in January alongside 46 other people -- mostly Sunnis -- found guilty of the same crime.
Rights activists say more than two dozen other Shiites are on death row in Saudi Arabia.