The militants targeted a military base about 80 kilometres east of the Suez Canal, local media reported.
Unknown gunmen opened fire on a checkpoint in central Sinai, attracting retaliatory fire from security forces.
Twelve soldiers were killed and eight were wounded, officials said. The injured have been admitted to hospital.
Egypt has has been battling Islamist militancy that primarily targeted policemen, judges and military personnel.
The militants are led by a local affiliate of the Islamic State group.
More From This Section
The attacks increased after the ouster of Islamist president Mohamed Morsi in 2013 following huge protests against his rule.
More than 700 security personnel have been killed in violence since then.
The military has launched security campaigns in the area, arrested suspects and demolished houses that belong to terrorists, including those facilitating tunnels leading to the Gaza Strip.