The charges also included having extremist views and forming an illegal group, the sources said. Those sentenced had been arrested in 2015.
The Cairo criminal court sentenced four other people in the same case to life in prison and three others to 15 years. Egypt's life sentence is 25 years.
Those who were in court to hear their verdicts on Thursday can appeal the decision within 60 days.
Egypt's army kills 4 more terrorists in "Sinai 2018" operation
Egypt has cracked down on suspected extremists since President Abdel Fattah al Sisi led the overthrow of former president Mohamed Mursi of the now banned Muslim Brotherhood. Sisi took office a year later.
With Egypt facing an Islamic State insurgency in the Sinai Peninsula, he has ordered the military to clear the region of extremists ahead of next month's presidential election.
Hundreds of extremists, including Muslim Brotherhood supporters and members, have received death sentences since 2013, and Egypt has carried out dozens of executions, according to security sources and rights groups.
COMMENTS
Comments are moderated and generally will be posted if they are on-topic and not abusive.
For more information, please see our Comments FAQ