Egyptian fighter jets carried out strikes on Friday directed at camps in Libya which Cairo says have been training militants who killed dozens of Christians earlier in the day.
President Abdel Fattah al-Sisi said he had ordered strikes against what he called terrorist camps, declaring in a televised address that states that sponsored terrorism would be punished.
Egyptian military sources said six strikes took place near Derna in eastern Libya at around sundown, hours after masked gunmen attacked a group of Coptic Christians travelling to a monastery in southern Egypt, killing 29 and wounding 24.
The Egyptian military said the operation was ongoing and had been undertaken once it had been ascertained that the camps had produced the gunmen behind the attack on the Coptic Christians in Minya, southern Egypt, on Friday morning.
"The terrorist incident that took place today will not pass unnoticed," Sisi said. "We are currently targeting the camps where the terrorists are trained."
He said Egypt would not hesitate to carry out further strikes against camps that trained people to carry out operations against Egypt, whether those camps were inside or outside the country.
Egyptian military footage of pilots being briefed and war planes taking off was shown on state television.
East Libyan forces said they participated in the air strikes, which had targeted forces linked to al-Qaeda at a number of sites, and would be followed by a ground operation.
A resident in Derna heard four powerful explosions, and told Reuters that the strikes had targeted camps used by fighters belonging to the Majlis al-Shura militant group.
Majlis al-Shura spokesman Mohamed al-Mansouri said in a video posted online that the Egyptian air strikes did not hit any of the group's camps, but instead hit civilian areas.
There was no immediate claim of responsibility for the attack on the Christians, which followed a series of church bombings claimed by Islamic State in a campaign of violence against the Copts.
Islamic State supporters reposted videos from earlier this year urging violence against the Copts in Egypt.
At a nearby village, thousands later attended a funeral service that turned into an angry protest against the authorities' failure to protect Christians.
"We will avenge them or die like them," mourners said, while marching with a giant wooden cross.
GUNFIRE AND BLOOD
Eyewitnesses said masked men opened fire after stopping the Christians, who were in a bus and other vehicles on a desert road. Local TV channels showed a bus apparently raked by gunfire and smeared with blood.
Clothes and shoes could be seen lying in and around the bus, while the bodies of some of the victims lay in the sand nearby, covered with black sheets.
Eyewitnesses said three vehicles were attacked. First to be hit was a vehicle taking children to the monastery as part of a church-organised trip, and another vehicle taking families there.
The gunmen boarded the vehicles and shot all the men and took all the women's gold jewellery. They then shot women and children in the legs.
When one of the gunmen's vehicles got a flat tire they stopped a truck carrying Christian workers, shot them, and took the truck.
One of the gunmen recorded the attack on the Copts with a video camera, eyewitnesses said.
The attack took place on a road leading to the monastery of Saint Samuel the Confessor in Minya province, which is home to a sizeable Christian minority.
Security forces launched a hunt for the attackers, setting up dozens of checkpoints and patrols on the desert road.
Police armed with assault rifles formed a security perimeter around the attack site while officials from the public prosecutor's office gathered evidence. Heavily armed special forces arrived later wearing face masks and body armour.
The injured were taken to local hospitals and some were being transported to Cairo. The Health Ministry said that among those injured were two children aged two.
U.S. President Donald Trump, who has made a point of improving relations with Cairo, said his country stood with Sisi and the Egyptian people.
"This merciless slaughter of Christians in Egypt tears at our hearts and grieves our souls," Trump said.
The Grand Imam of al-Azhar, Egypt's 1,000-year-old centre of Islamic learning, said the attack was intended to destabilise the country.
"I call on Egyptians to unite in the face of this brutal terrorism," Ahmed al-Tayeb said. The Grand Mufti of Egypt, Shawki Allam, condemned the perpetrators as traitors.
The head of the Coptic Christian church, Pope Tawadros, who spoke with Sisi after the attack, said it was "not directed at the Copts, but at Egypt and the heart of the Egyptians".
Pope Francis, who visited Cairo a month ago, described the attack as a "senseless act of hatred".
Coptic Christians, whose church dates back nearly 2,000 years, make up about 10 percent of Egypt's population of 92 million.
They say they have long suffered from persecution, but in recent months the frequency of deadly attacks against them has increased. About 70 have been killed since December in bombings claimed by Islamic State at churches in the cities of Cairo, Alexandria and Tanta.
An Islamic State campaign of murders in North Sinai prompted hundreds of Christians to flee in February and March.
Copts fear they will face the same fate as brethren in Iraq and Syria, where Christian communities have been decimated by wars and Islamic State persecution.
Egypt's Copts are vocal supporters of Sisi, who has vowed to crush Islamist extremism and protect Christians. He declared a three-month state of emergency in the aftermath of the church bombings in April.
But many Christians feel the state either does not take their plight seriously enough or cannot protect them against determined fanatics.
The government is fighting insurgents affiliated with Islamic State who have killed hundreds of police and soldiers in the Sinai Peninsula, while also carrying out attacks elsewhere in the country.