Both had the rank of brigadier general and were killed in the city of Sheikh Zuwaid. Security forces in Egypt are struggling to quell an Islamist insurgency that has killed scores of soldiers and policemen in the peninsula, which borders Israel and the Palestinian Gaza Strip.
The attacks surged after the military overthrew Islamist president Mohamed Mursi last year and the militants extended their reach to the Egyptian mainland with a series of bombings.
Separately, Egyptian militant group Ansar Bayt al Maqdis said three of their fighters had been killed in their car in Sinai region.
The group said they had been killed by an Israeli drone but an Egyptian Defence Ministry source denied the incident.