The defendants linked to 'Al-Zawahiri cell' were also accused of attacking army and police personnel, Christians and their churches, spreading chaos and threatening national security.
Fourteen other defendants were sentenced to 15 years in a maximum security prison in the same case.
The court acquitted Mohamed Al-Zawahri, the brother of Qaeda leader Ayman el-Zawahri.
Since Islamist ex-president Mohamed Morsi's ouster, the Egyptian government has been cracking down on the Muslim Brotherhood and its supporters.