One soldier and seven civilians died after a rocket, which security sources said was aimed at North Sinai's major security compound, instead struck a busy supermarket nearby. Two of the civilians killed were children. In addition, two more rockets then struck a security unit.
The military post and local government buildings are near a compound of residential buildings in the seacoast city.
Egypt's Interior Ministry said about 25 people were injured.
Egyptian militant groups have fired rockets toward Israel from the peninsula during Israel's assault on Gaza, which entered its seventh day. The militants, largely supporters of former President Mohamed Morsi, have found a relatively safe haven in Sinai. They have attacked military and police headquarters, and have rarely struck at civilian targets.