The Egyptian chapter of ISIS that likely carried out Friday's horrific attack in Bir al-Abd, Sinai, has also become a growing threat to a multinational force of peacekeepers that includes a contingent of 68 Canadian soldiers.
The Multinational Force and Observer mission, or MFO, has been in the Sinai since 1981 to guarantee the peace treaty between Egypt and Israel. Canada is one of the 12 nations responsible for the MFO and has played a prominent role in the mission.
Canadian Maj.-Gen. Denis Thompson, who retired from the military this year after a 39-year career, commanded the MFO from March 2014 to March 2017, extending his stay beyond the normal two years at the request of the organization.
Thompson was able to shepherd the force through an exceptionally violent period in the Sinai, without the loss of any of its 1,400-strong force.
But the MFO did suffer escalating aggression from the group, including sniper attacks, an IED, and mortar barrages on its base at El-Gorah. The attacks wounded several U.S. and Fijian troops under Thompson's command.
"They're very, very dangerous," Thompson told CBC News, "and they are going from strength to strength, from one spectacular attack to another."
Rapid growth after 2014
When Thompson arrived in the Sinai, there was already an active insurgency. A group called Ansar Beit al-Maqdis (Supporters of Jerusalem) had been targeting Egyptian security forces since the Egyptian revolution of 2011.
But the sudden eruption of Islamic State in Iraq and Syria onto the scene would transform the Sinai militants' fight.
Seven months after Thompson assumed command at El-Gorah, Ansar Beit al-Maqdis pledged allegiance to the newly declared ISIS caliphate, and renamed itself Wilayet Sinai (or "Sinai Province") of the Islamic State.
IS-Sinai had sophisticated weapons, including Kornet anti-tank guided missiles and surface-to-air missiles, and its senior ranks included former Egyptian Army officers.
It quickly became a deadly threat to Egyptian forces, said Thompson.
"They have increased the casualty count against the Egyptian Army to the point where they now probably kill on average one Egyptian soldier a day."
"The MFO has been attacked mostly on the periphery, being in the wrong place at the wrong time. Any deliberate attacks have been largely to send a message to the MFO to stay out of their business."
The business of IS-Sinai includes smuggling across the Egyptian-Israeli and Egypt-Gaza borders. It's one reason the group doesn't welcome foreign soldiers setting up observation posts.
A timely relocation
Documents obtained by CBC News last year through access to information show that the Canadian government began to reassess the risks of the mission in early 2016.
But rather than abandon the mission, which has helped to keep the peace in the Sinai for decades, MFO's leadership decided to redeploy their forces to safer areas.
What had previously been the main base and logistics hub for MFO at El-Gorah, close to the scene of today's deadly mosque attack, was scaled down to a forward operating base. Most of the force moved to the other MFO base at the southern end of the peninsula near Sharm el-Sheikh.
The forces stationed at El-Goreh were drawn down from 1,000 to 400, says Thompson.
"Markedly safer in the southern Sinai than the northern Sinai! They are like two different worlds completely."
But MFO continues to perform its functions in the dangerous northern half of Sinai, and Canadian troops continue to cycle through El-Goreh in what is currently Canada's largest deployment of peacekeepers anywhere in the world.
An earlier version of this story said that the Egyptian chapter of ISIS had claimed responsibility for the attack in Bir al-Abd, Egypt. In fact, no group had yet claimed responsibility when the story was published.Nov 24, 2017 6:21 PM ET