The source said 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.
More From This Section
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."
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.
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.