Like so much else in the Middle East, there are more theories and questions than answers over who, or what, was behind an explosion near the Gaza-Egyptian border overnight that killed two Palestinians and injured five others.

Citing Israeli defense officials, the Arabic Al-Jazeera news service reported Thursday that the Egyptian military was responsible for the explosion.

After the blast, Hamas, the terror group that controls the Gaza Strip, immediately pinned the blame on an Israeli airstrike, but the Israel Defense Forces denied involvement.

The spokesman of Gaza’s Hamas-run health ministry, Ashraf al-Qudra, named the two men killed as Hossam al-Sufi, 24, and Mohammed al-Aqra, 38.

A Palestinian security source told the Israeli Ynet news outlet that the two were in a weapons smuggling tunnel, located east of the Rafah crossing, at the time of their deaths. He added that the incident took place in an area where the Islamic State group in the Sinai controls smuggling tunnels and keeps its weapons arsenals.

The Palestinian security source also said it was possible the deaths were caused by an internal explosion within the smuggling tunnel, rather than by an airstrike.

That raised a third possible cause for the tunnel’s destruction — a weapons failure, rather than an outside attack. There is precedent. Over the weekend, a top Hamas munitions expert was killed during a work accident, possibly while preparing explosives.

Further complicating things, Thursday morning’s incident came after a night in which several rockets were fired by the Islamic State affiliate in the Sinai Peninsula at the Israeli Red Sea resort of Eilat.

After approximately 12 hours of uncertainty over who launched the rockets, on Thursday the Islamic State in Sinai released a statement taking credit for the attack.

“A military platoon fired a number of Grad rockets at communities of Jewish usurpers in the town of Eilat,” the statement said.

While the smuggling tunnel detonation occurred a few hours after the Eilat attack, it also came amid an ongoing Egyptian military operation targeting such underground infrastructure, raising the distinct possibility that the rocket fire and tunnel explosion were unrelated.

At 3 p.m. on Wednesday, some eight hours before the Eilat rocket attack, the Egyptian military announced that, between January 17 and February 4, it had destroyed six smuggling tunnels connecting the Sinai Peninsula with Gaza.

In 2016, the Egyptian military also reported destroyed 12 Sinai-Gaza smuggling tunnels as part of its crackdown on illegal trade.

Tunnels of this type, managed by Hamas on the Gaza side and Islamic State on the Sinai side, are used for both military objectives — transporting materiel and fighters to and fro — and commercial purposes, bringing retail goods into the beleaguered coastal enclave.

Egyptian forces have been battling an Islamist insurgency in northern Sinai, which escalated after the military overthrew Islamist president Mohamed Morsi in 2013.

Despite pressure from Egypt, Hamas has refused to crack down on smuggling by IS through tunnels run by its members under the Gaza-Sinai border. Instead, the Palestinian terror group has looked to the activity as a source of revenue.

The Islamic State Sinai Province was set up in 2011, ostensibly to attack Israel by firing rockets across the 240-kilometer (149-mile) border or sabotaging a gas pipeline that runs between Egypt and Israel.

But most of the fighting, by far, has been with Egyptian government forces and attacks on Israel have been relatively rare.

Jihadists have killed hundreds of Egyptian soldiers and policemen since the military overthrow of Islamist president Mohamed Morsi in 2013 unleashed a bloody crackdown on his supporters.

Hamas security forces patrol along the Gaza-Egypt border, April 14, 2016 in Rafah, in the southern Gaza Strip. (Said Khatib/AFP)

Hamas security forces patrol along the Gaza-Egypt border, April 14, 2016 in Rafah, in the southern Gaza Strip. (Said Khatib/AFP)

In 2011, assailants who came from the Sinai killed eight Israelis in a triple ambush north of Eilat. Israeli forces in pursuit killed seven attackers and five Egyptian police.

In 2013, four jihadists were killed by an Egyptian airstrike as they were about to fire a rocket at Israel, according to the Egyptian military.

And in 2014, two patrolling Israeli soldiers were wounded by unidentified men who fired an anti-tank weapon from the Sinai during an attempted drug-smuggling operation, according to the Israeli military.

In 2015, rockets fired from Sinai landed in southern Israel, but did not cause any casualties. The Sinai Province group claimed responsibility.

Avi Issacharoff and AFP contributed to this report.