Egypt's army said terrorists wearing explosive belts tried to storm a military camp in the Sinai Peninsula on Saturday in an assault that left eight soldiers and 14 attackers dead.
The militants blew themselves up outside the camp after they were prevented by security forces from entering, an army statement said.
"The armed forces were able today to foil a large terrorist operation," the military said.
Saturday's attack comes two months after the launch of a massive operation against militants in Sinai as well as parts of Egypt's Nile Delta and the Western Desert, along the porous border with Libya.
More than 100 extremists and at least 22 soldiers have been killed in an ongoing operation launched on February 9 against the terrorists, according to army figures.