The militants were travelling a car at Al-Saf town when the bomb detonated accidentally, state-news agency MENA said, quoting a security official.
Investigations are on to identify the bodies of the suspected militants.
The authorities said they were preparing an attack on a security services control point.
Militant attacks against the forces have escalated since the military's ouster of Islamist President Mohammed Morsi last year and its subsequent crackdown on his Muslim Brotherhood supporters.
Many policemen and soldiers have been killed in the attacks. The military has also launched frequent security campaigns in the area, arrested suspects, demolished houses that belong to terrorists and infrastructure like tunnels leading to the Gaza Strip.