Four former Hamas members took part in the Islamic State’s attack in the Sinai Peninsula that killed at least 23 Egyptian soldiers, a top Israeli defense official said Saturday.

According to the Coordinator of Government Activities in the Territories (COGAT) Maj. Gen. Yoav Mordechai, the four were previously members of Hamas’s military wing, but had left the group to join terrorists in Sinai. He did not say where the information had come from.

Mordechai, in a Facebook post, said this fact showed that Hamas is not actually helping Egypt fight Sinai’s jihadists but rather “enabling the free passage of terrorist elements between Gaza and Sinai and vice versa.”

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

He added that it also raised questions as to Hamas’s control over the Palestinian territory.

“Hamas and Islamic State are two sides of the same coin,” he wrote.

Egyptian police on Saturday said they had killed 14 alleged IS members in a raid on a training camp, a day after the jihadists carried out the deadly attack on soldiers.

Funerals were held across the country for at least 23 soldiers killed in Friday’s attack in the north of the Sinai Peninsula, one of deadliest against the military in years.

The interior ministry said police officers raided a desert training camp in the eastern province of Ismailiya, killing the 14 jihadists. At least five of them had been wanted on charges of joining IS, it said in a statement.

IS has been leading a deadly insurgency that has killed hundreds of policemen and soldiers since the army overthrew Islamist president Mohamed Morsi in 2013 and cracked down on his supporters.

The jihadists had attacked on Friday several Sinai checkpoints with car bombs and heavy gunfire in a coordinated assault, for which IS later claimed responsibility in a statement.

The military said it killed 40 of the assailants and that the attack killed or wounded 26 soldiers, without providing a death toll.

Groups other than IS have also carried out attacks in Egypt targeting policemen and judges. Gunmen on Friday shot dead a National Security Service officer as he was leaving his home north of Cairo. The militant group Hasm claimed responsibility.

On Saturday, the interior ministry said police killed two senior Hasm members in a shoot out near Cairo.