A suicide bomber blew himself up in the southern Gaza Strip on Thursday, killing a Hamas terrorist who was trying to stop the attacker from crossing into Egypt, Hamas announced, blaming an ISIS sympathizer for carrying out the unprecedented attack.

It marked the first time that Hamas, which has carried out dozens of suicide attacks over the years targeting Israelis, was itself struck in such an assault. The Hamas-run Interior Ministry said five other Hamas security forces and an accomplice of the bomber were wounded.

The ministry described the assailant and his colleague as “ideologically deviant” — a term Hamas uses to describe members of ISIS and other terrorists. There was no immediate claim of responsibility.

Hamas has ruled Gaza with an iron fist since seizing control of the coastal area in 2007. Hamas has since clashed repeatedly with more radical terror groups, which have carried out their own attacks against Israel in part to undermine Hamas.

Hamas has sought to secure Gaza’s borders in order to improve relations with neighboring Egypt, which is battling an ISIS affiliate in the neighboring Sinai Peninsula.

Groups inspired by ISIS, al-Qaida and others have created a headache for Hamas in recent years, accusing it of being too soft on Israel and failing to fully impose Islamic law. Such groups have bombed internet cafes and music stores, and attacked Christians. Jihadis killed an Italian activist in Gaza in 2011.