(CNN) Thirty militants and four soldiers were killed Thursday in clashes in northern Sinai, according to an Egyptian military spokesman.

The violence erupted near a security checkpoint at the city of Sheikh Zuweid, said Brig. Gen. Mohamed Samir.

ISIS claimed responsibility for the attack that targeted troops.

In a statement, it claimed that the Egyptian army had tried to push forward toward the village of Toma, but that the group's militants succeeded in forcing the troops back by carrying out attacks and killing military personnel.

Security forces have been battling militants in northern Sinai for several years.

Read More