Hamas’s military wing is playing a double game with Islamic State-affiliated forces in the area, according to recent Israeli intelligence assessments.Within the Gaza Strip – where Hamas rules with an iron fist – the military wing has begun an unprecedented crackdown against pro-ISIS elements that have been firing rockets into southern Israel in recent weeks.This crackdown includes record number of investigations and arrests by its forces targeting Salafi jihadists, such as members of the Omar Brigades, who are responsible for rocket fire into Israel this summer. Those who comply with Hamas’s demand to respect the truce with Israel receive increased support from the ruling Islamist movement, according to the assessments. Hamas is concerned with avoiding retaliation to rocket fire from Israel, which would hamper its efforts to rebuild its forces after last summer’s 50-day conflict.“Hamas knows to encourage groups, or to give them a slap,” a senior IDF officer said on Tuesday, discussing the regime’s efforts to enforce the truce and keep Salafi jihadists in check.Yet in the Sinai Peninsula, Hamas’s military wing, the Izzadin Kassam Brigades, is understood to be cooperating tactically with Wilayat al-Sinai (Sinai Province), an ISIS-affiliated terrorist organization. In recent days, the group carried out its most ambitious, coordinated and deadly attack on Egyptian security forces in northern Sinai, resulting in dozens of casualties.Despite a failure to receive the consent of Hamas’s political wing, the military wing maintains cooperation with Wilayat al-Sinai, giving it access to Gaza, from where the Sinai-based organization smuggles weapons and funds, and receives training. Hamas gains from the relationship by receiving access to the Egyptian side of Rafah, enabling it to continue smuggling efforts and bypass Israeli and Egyptian security blockades. Hamas could also use the partnership to facilitate attacks on Israel territory away from Gaza, such as rocket attacks against Eilat from Sinai.According to the IDF, the relationship is based purely on opportunism. The organizations are ideologically hostile to each other, and are in fact embarrassed by their cooperation.“The local, shared interests trumped ideology,” the senior source stated, adding that the link between the two groups “could not have gone ahead without authorization from the highest ranks in the Hamas military wing.”Meanwhile, despite continued Hamas efforts to get closer to the Egyptian government, Cairo regards the movement as an enemy inexorably tied to its most virulent domestic enemies: the Muslim Brotherhood and Salafi jihadists.