Six Islamist militants, including a fugitive ex-army major, have been sentenced to death in the brutal murder of a gay rights activist and his friend in 2016.

“They will be hanged by the neck until their death,” Judge Md Majibur Rahman of the Anti-Terrorism Special Tribunal pronounced on Tuesday.

Four of the convicts were on the dock while the rests are on the run to evade justice.

In April 2016, Islamist militants hacked to death Xulhaz Mannan and his friend Mahbub Rabbi Tonoy.

Mannan was an editor of Bangladesh’s first gay rights magazine and had worked for the US Agency for International Development (USAID).

The killings in an apartment in Dhaka were part of a wave of attacks targeting foreigners, religious minorities and secular bloggers.

The judge said he was handing down the capital punishment as there was no scope for showing the convicts any mercy because of the heinous crimes they committed by killing the LGBT+ activist and his friend.

The court acquitted two of the eight accused, who were indicted initially, while four of the convicts were handed down the death penalty in another case over the murder of a progressive writer and publisher Faisal Arefin Dipan in 2015. Prosecutors identified all of them as members of outlawed Ansar-al-Islam, a domestic militant group.

Ansar-al-Islam describes itself as an Al-Qaeda affiliate in the Indian sub continent with sacked military Major Ziaul Haque being its armed wing leader but Bangladesh insists there is no presence of any foreign terrorist group in the country calling the militant outfits as home-grown ones.