CAIRO (AP) — An Egyptian court sentenced one of the country’s most high-profile militants to death Wednesday for his participation in scores of attacks on government targets.

The military court said in a statement that it convicted Hisham el-Ashmawi, a former special forces officer turned Islamist militant, on terror charges and sentenced him to hang.

Last year, the self-styled Libyan National Army, led by strongman and close Egypt ally Gen. Khalifa Hifter, captured and extradited el-Ashmawi.

For years, Egypt’s security forces considered el-Ashmawi the country’s most wanted militant for his intelligence value as Egypt fights Islamist militant groups in the restive north Sinai Peninsula and the vast Western Desert.

Egyptian authorities linked el-Ashmawi, 41, to several major attacks, including a 2013 attempt to assassinate the interior minister, Mohammed Ibrahim, along with devastating assaults on security forces near Egypt’s porous desert border with Libya.

While in Egypt, el-Ashmawi mobilized a tiny jihadist group into a well-organized guerrilla band that launched deadly ambushes on military checkpoints in northern Sinai.

After fleeing to Libya, he tried to establish himself among Islamic militants and extremists in the country’s east. He created al-Mourabitoun, a militant group blamed for most of the attacks in Egypt’s remote Western Desert, such as a 2017 ambush that killed nearly 30 Christian pilgrims on their way to a monastery.

In response to Islamist militant attacks, Egypt has granted police forces and courts sweeping powers, but rights observers say the crackdown has resulted in an abandonment of due process and violations of international law.