The attack involved a militant ambush on a border guard checkpoint west of the Mediterranean town of Rafah, which borders the Gaza Strip.
The military said at least five soldiers, including an officer, were killed in the attack. At least seven activists were also killed, he added.
It was the second militant attack in less than a week.
Last Saturday, at least 11 soldiers were killed, in one of the deadliest attacks on Egyptian security forces in recent years.
The Islamic State group also claimed responsibility for the attack, which took place in the town of Qantara in the province of Ismailia, which lies east of the Suez Canal.
Egypt is battling an insurgency in the Sinai that escalated after the military toppled an elected but divisive Islamist president in 2013. Extremists have carried out numerous attacks, mainly targeting security forces and Christians, but the pace has slowed in recent years.
washingtonpost Gt