The verdict was delivered by a court in Riyadh "specialising in terrorism cases," state news agency SPA reported.
The authorities set up specialised courts in 2011 to try Saudis and foreigners accused of belonging to Al-Qaeda or involvement in a spate of deadly attacks in the kingdom from 2003-2006.
The group, three of whom were foreigners, were accused of using a firearm to attack the policemen, killing one of them and three civilians and wounding 12 members of the security forces, SPA said.
SPA said the cell planned to launch attacks on targets inside the kingdom "with civilian aircraft". They had also planned to attack a Saudi boat in an unnamed Gulf port, the agency reported.
Also Read
In addition to the two men sentenced to death, another 13, three of whom are foreigners, were given jail terms ranging between 14 and 35 years.
Two Moroccans received sentences of 30 and 18 years respectively and a Yemeni was jailed for 20 years.
The group has 30 days to appeal.
King Abdullah in February decreed jail terms of up to 20 years for citizens who travel abroad to fight, after the conflict in Syria attracted hundreds of Saudis.