While Hamas is far from reticent about showing off the drones it has sent into Israel several times over the past year, it appears that the Jewish state is not the only target of the terror group’s covert UAV activity.

Last December, the unmanned aircraft were given pride of place at a military parade to mark the group’s 27th anniversary, including a drone that Hamas claimed had been in operation during the conflict that summer. And it is becoming clear to Israeli officials that intelligence-gathering for military operations is not the sole purpose of the craft.

When a Hamas drone crashed on Israel’s side of the Gaza border fence two weeks ago, it was picked up by IDF officials and examined by the various intelligence agencies. They discovered that the drone, in addition to monitoring events inside Israel, was also photographing Gaza’s border with Egypt.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

This is not the first time that Hamas has operated a UAV inside Egyptian territory. Four months ago, Egyptian news outlet Al Usbu reported that Egyptian radar had identified three spy drones that had infiltrated repeatedly from southern Gaza. According to the report, the drones reached the vicinity of El Arish and Sheikh Zuweid, roughly 50 kilometers (30 miles) from the southern Gaza Strip.

The report said that Egyptian border police troops had opened fire on the drone, but did not manage to hit it, as it was flying at an altitude of some 750 meters (820 yards).

Trouble on the Gaza-Sinai border

So what are Hamas drones doing deep inside Egyptian territory? Simple — they are spying on Egypt, gathering intelligence about Egyptian troop movements along the border with Gaza.

Hamas’s objective is not necessarily a terror attack against Egypt, but rather tracking troop movements, the location of army positions and deployments in order to allow members of its military wing, Izz ad-Din al-Qassam, to keep smuggling routes open between Sinai and Gaza. These routes are vital to Hamas on one side of the border, and Islamic State on the other.

This is one of the most carefully guarded secrets of the Hamas military wing in recent months — a close cooperation with the members of the Islamic State-affiliated Wilayat al-Sina, “Province of Sinai,” which was previously known as Ansar Bait al-Maqdis.

Egyptian army officials were among the first to grasp the depth of the relationship. It is for this reason that Egypt has been expending so much energy on destroying tunnels under the border and putting a stop to the smuggling from Sinai to Gaza and vice versa.

Egypt’s security forces have in the past two years been concentrating their activity on Sinai in an attempt to isolate the northeastern corner of the peninsula. The objective is to isolate the corner of Sinai containing El Arish, Rafah and Sheikh Zuweid from the Gaza Strip and from the rest of peninsula.

The problem is that this corner happens to be the most strategically significant area for Hamas in Gaza and for Islamic State in Sinai, both economically and in terms of security. The smuggling route between the Gaza Strip and Sinai gives both sides a constant supply of arms, combat forces, instructors and advisers, while raking in huge profits from the smuggling industry in Gaza.

Trouble began for Islamic State operatives in Sinai and the heads of the Hamas military wing in Gaza as soon as Egypt began its offensive against the tunnels in the area of the Philadelphi Corridor in June 2013. Their interests were threatened, and the two terror groups were forced to cooperate to hold on to even a fraction of the ability to smuggle arms and personnel into the Gaza Strip.

Bedouin ties

But mutual interests are not the sole factor at work in this rapprochement. Members of the same Bedouin tribe are active on both sides of the border, both in Gaza and in Egypt.

The most noticeable example is Shadi al-Mani’i, a member of this tribe, and one of the best-known terror operatives in Sinai. Al-Mani’i hid in Gaza for many months under the protection of the heads of the Hamas military wing.

The shared desire to protect the smuggling routes and the need for good relations with this clan have led to closer ties between Islamic State commanders in Sinai and high-ranking members of Hamas’s military wing.

This relationship is manifested in a number of ways:

First, the members of Izz ad-Din al-Qassam have helped train and equip IS operatives in Gaza and Sinai. One of the best-known figures — according to Israel’s Coordinator of Government Activities in the Territories Maj. Gen. Yoav Mordechai — is Abd al-Hila Kishteh, a former high-ranking member of the Hamas military wing who was dispatched by Hamas to Sinai. He had been Hamas’s point man for attacking IDF tanks, as well as on the use of complex explosives. Kishteh had severed ties with Hamas and announced that he was joining the Popular Resistance Committees, but over the past year he has been training Islamic State fighters in Sinai in the use of advanced anti-tank weapons.

Second, Islamic State’s efforts over the past few months in Sinai to become an established, institutional entity, evidenced by its members’ recent activities, is influenced in part by the commanders of Hamas’s military wing. Even a cursory glance at these operatives’ appearance and mode of dress shows the extent of the evolution IS is undergoing in the Sinai district — and they have Hamas in Gaza to thank for most of it, as it is there, while undergoing training and military studies with Hamas in the Strip, that Sinai’s IS leaders gained the military doctrines they have been imparting to their operatives in Sinai.

Third, Hamas pointedly takes wounded members of IS to hospitals in the Gaza Strip, where they are treated under Hamas supervision. The numbers are not high, nor is this done on a constant basis. Only a select few receive such treatment, and only if their condition allows for it — members of the right tribe or clan, or people who are considered close to the heads of Hamas’s military wing.

The terror attack

The brazen July 1 attack by IS operatives in the northern Sinai that killed scores of Egyptian soldiers was not a complete surprise to the Israelis or the Egyptians. Egyptian intelligence had predicted that terrorists would attempt a large-scale terror attack during the Muslim holy month of Ramadan. But in this case, there was more than general intelligence about the intent to commit a terror attack, and Islamic State operatives were seen preparing for it 24 hours in advance.

The attack was a success only in psychological terms, with IS conveying a clear message to the Egyptian army that it was capable of attacking several targets simultaneously and killing many troops. But at the operational level, the incident was not a success for the group, to put it mildly. Roughly 250 Islamic State operatives were killed during the raid, a huge number in proportion to the relatively small count of combat troops (approximately 1,000) that the group has in Sinai.

IS also failed in its bid to create a foothold in the territory between Sheikh Zuweid and Rafah. The Egyptian army continues to show that it is in control even in terrorism-plagued areas in northeastern Sinai.

But the Egyptian army has more problems than what has been going on recently. The strategic view that informed its actions — isolating the northeastern part of Sinai and controlling the rest of the territory — proved too dangerous. The Egyptian army cannot continue allowing Islamic State personnel to remain undisturbed in the Sheikh Zuweid-El Arish region, and will have to strike them there while preventing them from taking any ground elsewhere.

The second and perhaps more difficult problem lies in the support IS is receiving from the peninsula’s Bedouin population. Many of IS’s operatives in Sinai, who are local inhabitants, form the hard core of the group, though Saudis, Libyans and Egyptians have been joining up.

Most of the tribes in the Sinai Peninsula give ideological or practical support to the Islamic State — more because of their animosity toward the Egyptian army, which treats them like second-class citizens, than out of any love for the group. The Sawarkah, Barikat and al-Mani’i tribes, among the largest in Sinai, together with others, are considered supporters of Islamic State.

Egyptian intelligence officials are themselves wondering how much Hamas’s leadership actually knows about all this cooperation. And the answer to this question depends on another: Who, exactly, makes the decisions within Hamas’s Gaza leadership — the military or the political wing, or both?

The answer to the first question is fairly obvious. The leadership of the military wing knows and approves the cooperation between the Islamic State and its own personnel. The likelihood that the military wing’s commanders do not know about it is nil. This is a group with a clear hierarchy, trained to obey orders.

For example, the members of Izz ad-Din al-Qassam have not fired a single shot at Israel since the end of the war last August. Why? Because they are under orders not to. A relationship as intensive as the Hamas-IS cooperation cannot exist without the approval of the military high command, men such as Muhammad Deif, Marwan Issa, Yahya Sinwar and others.

There is no doubt that Hamas’s internal balance of power has changed significantly over the past decade. The political echelon has no key spiritual or political figures like the ones who operated in Gaza in the past, such as Sheikh Ahmed Yassin and Abd el-Aziz Rantisi. The status of the military wing increased after Operation Protective Edge, and its personnel (mainly Muhammad Deif) are thought to have as much political authority as former Gaza prime minister Ismail Haniyeh.

Ironically, the close coordination between Hamas’s military wing and Islamic State in Sinai does not mitigate Hamas’s intensive efforts against home-grown IS-style Salafists in the Gaza Strip. Even as the military wing is cooperating with the jihadists in Sinai, its members are fighting their ideological kin in Gaza. How does the group reconcile the two policies? In the contemporary Middle East, everything is possible.