“The Egyptian army controls all of northern Sinai,” army spokesman Brig. Gen. Mohammed Samir proclaimed on Thursday. “Now the investigations will begin into where the terrorists came from, who helped them and how they obtained uniforms similar to Egyptian army uniforms.”

After 24 bloody hours in which at least 17 soldiers and some 100 militants were killed from Wilayat Sinai (formerly known as Ansar Bayt al-Maqdis before affiliating with Islamic State, also known as ISIS or ISIL), the Egyptian army is indeed present in northern Sinai, and the fighting has died down. But its claim of “control” is debatable.

Nobody knows how many terrorists participated in the coordinated attack that stunned the army on Wednesday by assaulting 15 military checkpoints and facilities simultaneously. And no one knows how many are in Sinai.

Two years ago, the Egyptians estimated that Ansar Bayt al-Maqdis had some 4,000 fighters, mostly Egyptian and some foreign. But many of the latter left for Libya to establish a base for ISIS in that country.

When it was first founded and prior to joining ISIS, Ansar Bayt al-Maqdis focused more on attacking Israeli targets – including the pipeline that used to carry Egyptian gas to Israel. But it has always attacked the Egyptian police and military as well.

The group is just one of about a dozen militias operating in northern Sinai and the rest of Egypt. Others have also perpetrated murderous attacks, such as the killing of 16 Egyptian soldiers in Sinai in August 2012.

And that was long before the Egyptian counterrevolution toppled President Mohammed Morsi and the Muslim Brotherhood in June 2013.

But the wave of terror intensified greatly after current President Abdel-Fattah al-Sissi ousted Morsi. Sissi has waged war on the Muslim Brotherhood – including declaring it a banned terrorist organization – and both the government and media blame it for the violence in Sinai.

Nevertheless, Sissi’s uncompromising war hasn’t reduced the terror. Moreover, the connection the government makes between the Brotherhood, Hamas, Hezbollah and jihadi militias in Sinai has created the impression that it’s looking for excuses to justify its battle against the Brotherhood. There is no real proof of any military connection between the Brotherhood and the others.

Granted, Hamas is an ideological offshoot of the Brotherhood, and it once cooperated routinely with both Hezbollah and the Sinai jihadists. The latter let Hamas use their smugglers and arms stockpiles; in exchange, Hamas provided safe haven to jihadists pursued by Egyptian security forces.

But circumstances have changed. Hamas severed ties with Syria, Iran and Hezbollah over the ongoing Syrian civil war, and its forces in Syria’s Yarmouk refugee camp have even fought the Syrian army and Hezbollah there.

Though Qatar and Turkey replaced Iran as its financial patrons, this did Hamas little good. Egypt closed its Rafah border crossing with Gaza and destroyed most of the smuggling tunnels to Sinai, while Israel maintained its naval blockade of the Strip, severely restricted access from Israel and pressured Palestinian banks not to transfer funds to Hamas.

This joint Israeli-Egyptian blockade seemingly left Gaza an isolated, neutralized island incapable of harming anyone.

But in January, when King Salman ascended the throne of Saudi Arabia, things changed. Salman saw Hamas as a card to play in his battle against Iranian influence.

He pressured Egypt into rescinding Hamas’ designation as a terrorist organization, just two months after a court announced it; Egyptian officials began meeting with Hamas representatives; senior Egyptian officers praised Hamas in the media for its efforts to prevent cross-border infiltrations in both directions; Egypt approved a limited reopening of the Rafah crossing, which, for the first time, included goods as well as people; and there were rumors of indirect Hamas-Israel talks on a long-term cease-fire.

Consequently, though Egyptian officials hastened to tie Hamas to Sinai jihadists after previous attacks in the peninsula, this time, neither military officers nor government officials linked Hamas to the Wilayat Sinai attack. Pundits, researchers and some civil-society organizations did accuse Hamas – not of cooperation with Islamic State, but only of cooperating with the Muslim Brotherhood.

Thus, contrary to Israeli predictions, it seems Cairo intends to preserve its ties with Hamas, distinguish between Hamas and Islamic State, and even treat Hamas as if it weren’t part of the Brotherhood.

Indictments against several senior Brotherhood officials that were published last week quote wiretapped conversations showing that Hamas members, at the Brotherhood’s behest, came to Egypt on the eve of the 2011 revolution to help break Brotherhood activists out of jail.

Yet Egypt hasn’t indicted senior Hamas officials or demanded their extradition; evidently, it prefers not to upset its ties with the organization.

Indeed, Egypt’s main problem isn’t Hamas, but Islamic State and other jihadi groups in Sinai. Even though the army claims to uncover new terror cells or weapons stockpiles every day, the frequency, scope and targets of the attacks show both the weakness of Egyptian intelligence and the strength of the militias’ logistical infrastructure.

Egyptian experts now expect the security services to take the gloves off against the Muslim Brotherhood – which they certainly did on Wednesday when they assassinated nine Brotherhood activists meeting in Cairo, rather than arresting them. The government might also execute senior Brotherhood officials, including Morsi.

But such steps are unlikely to have any effect on the behavior of the jihadi groups. Just two months ago, those groups blamed the Brotherhood’s plight on its decision to abandon jihad in favor of “democracy and reconciliation.”