Egyptian jets bombed Islamic State targets in Libya on Monday, a day after the group there released a video showing the beheading of 21 Egyptian Christians, drawing Cairo directly into the conflict across its border.
Egypt said the pre-dawn strike hit militant camps, training sites and weapons storage areas in the neighbouring oil-producing country, where factional fighting has unleashed virtual anarchy and created havens for jihadi Islamists.
While Cairo is believed to have provided clandestine support to a Libyan general fighting a rogue government in Tripoli, the 21 decapitations pushed President Abdel Fattah al-Sisi into open action, expanding his battle against Islamist militancy.
"And let those near and far know that the Egyptians have a shield that protects and preserves the security of the country, and a sword that eradicates terrorism," the Egyptian military said in a statement.
Egyptian state television aired footage of fighter planes leaving a hangar with "Long live Egypt" emblazoned on their tails, followed by night-vision aerial footage showing bomb explosions and the aircraft returning in early daylight.
Libya's air force also participated in Monday's attack, which targeted Derna, an eastern coastal city regarded as a base for fighters of the ultra-radical Islamic State.
"There are losses among individuals, ammunition and the (Islamic State) communication centres," Libyan air force commander Saqer al-Joroushi told Egyptian state television, adding that dozens had been killed.
Joroushi, who is loyal to Libya's internationally recognised government, which set up camp in the city of Tobruk after losing control of the capital Tripoli, said there would be more strikes on Tuesday.
The rival Tripoli-based parliament, which is supported by some Islamist groups, said the air raids
were an assault on Libya's sovereignty. Omar al-Hassi, premier of the self-appointed Tripoli government, said three children, two elderly men and a 21-year-old woman were killed in the attack.
It was not possible to confirm either faction's accounts of the number or nature of the casualties.
Cairo called on the U.S.-led coalition fighting Islamic State in Iraq and Syria to broaden the scope of their operations to include Libya, highlighting how the insurgent group has expanded its reach around the Arab world.
Since the fall of strongman Muammar Gaddafi in 2011, a number of Islamist movements have taken hold in Libya. Recently, some have declared ties to Islamic State and claimed high-profile attacks in what appears to be an intensifying campaign.
The U.S. military estimated in December that only around 200 Islamic State fighters were operating in the country.
Egypt is not the only Arab nation sucked into confrontation with the group by the gruesome killings of its citizens.
Jordan has taken a leading role in conducting air strikes against the group in Syria and Iraq this month after the militants released a video showing a captured Jordanian pilot being burned alive in a cage.
The 21 Egyptian Coptic Christians were marched to a beach, forced to kneel and then beheaded on video, which was broadcast via a website that supports Islamic State.
The victims were among thousands of unemployed Egyptians desperately seeking work in Libya, despite the risks. Egypt's foreign ministry said it was banning travel to Libya and had set up a crisis centre to bring home Egyptians.
Thousands of traumatized mourners gathered at the Coptic church in al-Our village, where 13 of the 21 victims came from, struggling to come to terms with the fate of compatriots who paid a gruesome price for simply seeking work.
Before the videoed killings, one of the militants stood with a knife in his hand and said: "Safety for you crusaders is something you can only wish for." Afterwards, he says: "And we will conquer Rome, by the will of Allah."
The head of the Roman Catholic Church, Pope Francis, condemned the beheadings. "They were killed simply for the fact that they were Christians," he said at the Vatican.
Egypt's Coptic Christian pope was one of the public figures who backed Sisi when he, as army chief, ousted Islamist president Mohamed Mursi in 2013 after mass protests against him.
The killings put pressure on Sisi to show he is in control of national security, even as he makes progress against Islamist militant insurgents in the Sinai, some of whom have recently pledged allegiance to Islamic State.
"It's swift and decisive, it's not about strategy, it's about containing anger within Egypt," said Hassan Hassan, co-author of a book on Islamic State.
"Just like in Jordan, it's more about saving face, saying: 'You can't mess with us'. .... It's likely to evolve into a sustained strategy of helping in the fight against ISIS (Islamic State) in neighbouring countries."
Fears the crisis in Libya could spill across the border had already prompted Egypt, the Arab world's most populous nation, to upgrade its military hardware.
Egypt signed a 5.2 billion-euro deal to buy French weaponry on Monday, Egyptian media said, including 24 Rafale combat jets made by Dassault Aviation, a multi-mission naval frigate, and air-to-air missiles.
(Reporting by Ahmed Tolba, Omar Fahmy, Shadi Bushra in Cairo, Ulf Laessing, Patrick Markey and Mark Hosenball in Washington; Writing by Yara Bayoumy; Editing by Michael Georgy, Crispian Balmer and Mark Heinrich)