CAIRO — Libyan forces have captured one of the region’s most dangerous Islamist militants, a former Egyptian special forces officer with ties to al-Qaeda who authorities say made it his mission to target Egypt’s security forces and destabilize the country.

Hisham al-Ashmawy, described by some security officials as Egypt’s most wanted man, was taken into custody Friday in the eastern Libyan city of Derna, a spokesman for the self-proclaimed Libyan National Army said in a statement posted on Facebook. The LNA also posted a photo of a bloodied Ashmawy, apparently taken after his arrest.

LNA forces, led by an eastern-based strongman opposed to the U.N.-backed government in Tripoli, have been fighting Islamist militants in Derna for months. Ashmawy had been using Derna, about 165 miles west of the Egyptian border, as a springboard to cross into Egypt and launch attacks.

Egyptian security officials on Monday confirmed the capture of Ashmawy and called for his extradition, according to local media reports.

“This would be a very big deal if true,” H.A. Hellyer, a senior nonresident fellow at the Atlantic Council, wrote in a tweet. “Al-Ashmawy’s profile in both Libya and Egypt has been substantial.”

Egyptian security officials consider Ashmawy the leader of Ansar al-Islam and another ­militant group, al-Mourabitoun. Both groups have ties to al-Qaeda in the Islamic Maghreb, the terrorist network’s North and West African affiliate.

A year ago, Ansar al-Islam asserted responsibility for an ambush in Egypt’s Western Desert that killed at least 16 security-force members. Egypt also blames the group for an assassination attempt against the then-interior minister in 2013 and the killing of Cairo’s top public prosecutor in 2015, among other attacks.

Ashmawy, a former Egyptian special forces commando, was fired from the military after he became radicalized. He joined a militant group in Egypt’s northern Sinai that emerged after the 2013 coup that ousted President Mohamed Morsi and the subsequent crackdown on his Muslim Brotherhood party.

But when the Sinai group pledged allegiance to the Islamic State, Ashmawy split off and formed his own outfits that would later link with al-Qaeda. His network recruited many disillusioned Egyptian troops, analysts said.

Ashmawy and his cohorts also were competing against the Islamic State in Libya and Egypt for influence; in Libya, both sides have battled each other.

His arrest, analysts said, offers a much needed boost to Egypt’s counterterrorism campaign. Militant attacks are a key reason the country’s tourism industry, the main source of foreign currency, has declined since the 2011 Arab Spring revolution that ousted longtime leader Hosni Mubarak.

But few analysts expect Ashmawy’s arrest to have a huge effect on militancy in Egypt. His group, while still considered a threat, has not staged any large-scale attacks this year. President Abdel Fatah al-Sissi has more pressing problems with the Islamic State’s Sinai affiliate, which asserted responsibility for downing a Russian passenger plane in 2015 as it left the resort town of Sharm el-Sheikh, killing all 224 people aboard.

In February, Sissi launched a major offensive against the Islamic State in northern Sinai. Since then, hundreds of militants have been reported killed, including 52 on Monday.

Still, most analysts say Egypt’s military continues to face steep obstacles against the Islamic State, also known as ISIS, in Sinai.

“Certainly, this could be seen as a morale boost for Egypt, after blaming Ashmawy for major attacks — especially against security force and government officials — for over five years,” said Zack Gold, a Middle East analyst. “However, it’s unlikely to have any impact in the short term on Egypt’s counterterrorism fight. Egypt still faces its biggest threat from ISIS, which itself was battling Ashmawy in Libya.”

Heba Farouk Mahfouz in Cairo contributed to this report.