Today's sentences come after consultation with the Grand Mufti, Egypt's top religious authority, over preliminary death sentences handed to the defendants in June. The consultation is a formality followed by courts in the cases of capital punishment.
The sentences are subject to appeal.
The court handed other defendants a variety of jail terms up to life in prison. Of 67 defendants, 15 are still at large.
Hisham Barakat was the most senior government official killed by Islamic militants since the 2013 military ouster of former Islamist President Mohamed Morsi, Egypt's first democratically elected president whose one-year rule proved divisive.