An ex-special forces officer turned ISIS terror leader has been sentenced to death for the third time alongside 36 others in Egypt.

Hisham al-Ashmawy was captured in Derna, Libya, in late 2018 and was transferred back to Egypt in May last year by commander Khalifa Haftar.

He is accused of killing 54 people in total and has been convicted on several charges, including plotting a 2014 attack that killed 22 military guards near the frontier with Libya.

That conviction saw him sentenced to death in absentia back in 2017.

Hisham al-Ashmawy (pictured) was captured in Derna, Libya, in late 2018. He has now been sentenced to death three times

In November, a military court had already sentenced Ashmawy to death in another terrorism case.

He was also involved in an attempt to kill former interior minister Mohamed Ibrahim in 2013, a military statement said.

Ashmawy led the Sinai-based Ansar Bayt al-Maqdis, Egypt's most active militant group, before it pledged allegiance to Islamic State in 2014, it said.

The other 36 defendants tried with him were also convicted of terrorism charges, the court ruled.

Their cases were referred to the Grand Mufti, Egypt's highest Islamic legal official.

Egyptian law requires any capital sentence to be referred to him for an opinion before executions can take place.

He is accused of killing 54 people in total and has been convicted on several charges, including plotting a 2014 attack that killed 22 military guards near the frontier with Libya. Pictured is a propaganda video by an al-Qaeda group which featured their leader, al-Ashmawy

The court set a new session for March 2 to confirm the convictions after receiving the Mufti's non-binding opinion.

He was dismissed from the special forces in 2012 over concerns about his religious views.

He then joined the Sinai-based Ansar Beit Al-Maqdis but broke with the group after it pledged allegiance to the Daesh group in November 2014.

Known by his nom de guerre 'Abu Omar Al-MuHajjir,' Ashmawy announced the formation of an Al-Qaeda-aligned militant group Al-Mourabitoun in Libya in July 2015.

He is also accused of being behind attacks in Egypt's Western Desert region.