Three of the dead were police who were on duty at Mar Mina church.
One attacker was killed and his explosives belt was defused. Another gunman managed to escape.
Security services announced plans this week to protect festivities around the New Year and Coptic Christmas. They include the deployment of rapid reaction forces and jamming equipment.