Three suspected ISIS militants have been sentenced to death by firing squad for beheading two Scandinavian hikers in Morocco last year.

Suspected ringleader Abdessamad Ejjoud and two others - believed to be Jounes Ouzayed and Rashid Afatti - were handed the maximum sentence on Thursday after begging Allah for forgiveness.

The men had filmed themselves beheading Norwegian Maren Ueland, 28, and 24-year-old Louisa Vesterager Jespersen, from Denmark, in Morocco's High Atlas Mountains in December.

Abdessamad Ejjoud (right) was handed the death penalty for beheading two Scandinavian hikers on Thursday, while two others - believed to be Rachid Afatti (left) and Ouziad Younes (centre) - were also sentenced to death

The suspected ISIS militants were handed the penalty for killing Maren Ueland, 28 (left), and Louisa Vesterager Jespersen, 24 (right), in December last year

The footage was later circulated in Islamist circles online. In the video the men can be heard branding the women 'enemies of God'.

A separate video showed four of the men pledging allegiance to ISIS leader Abu Bakr al-Baghdadi in front of a black and white ISIS flag.

All 23 defendants addressed the court on Thursday, most pleaded with Allah for mercy, before the judges retired to decide their fate.

In his closing arguments in June, the prosecutor described the three as 'human beasts' and asked for death sentences.

Thursday's sentencing marks the first time since 1993 that Morocco has handed out the death penalty.

The verdicts were given at a final court session of the 11-week trial in Sale, near the capital Rabat.

Journalists gathered outside the anti-terrorist court ahead of verdicts expected to be announced later Thursday in the case that has shocked the North African country.

'We expect sentences that match the cruelty of the crime,' lawyer Khaled El Fataoui, speaking for the family of Danish victim Louisa Vesterager Jespersen, told AFP.

Helle Petersen, her mother, in a letter read out in court last week, said: 'The most just thing would be to give these beasts the death penalty they deserve.'

Petitions on social media have likewise called for their execution.

Lawyers for the 23 accused men were in court for the sentencing on Thursday (pictured), where most begged for forgiveness from Allah

The three admitted to killing Jespersen, 24, and 28-year-old Norwegian Maren Ueland, whose family has declined to take part in the trial.

The prosecution has called for jail terms of between 15 years and life for the 21 other defendants on trial since May 2.

A life sentence has been sought for Abderrahim Khayali, a 33-year-old plumber, who had accompanied the three alleged assailants but left the scene before the murders.

The prosecution called for 20 years in jail for Kevin Zoller Guervos, a Spanish-Swiss convert to Islam.

The only non-Moroccan in the group, Guervos is accused of having taught the main suspects how to use an encrypted messaging service and to use weapons.

His lawyer, Saad Sahli, said Guervos had cut all ties with the other suspects 'once he knew they had extremist ideas' more than 18 months ago.

Members of the Moroccan security forces stand guard as a vehicle transporting jihadist suspects charged over the brutal murder of two Scandinavian women hiking in Morocco

All but three of those on trial had said they were supporters of the Islamic State group, according to the prosecution, although IS itself has never claimed responsibility for the murders.

The three killers of the women were 'bloodthirsty monsters', the prosecution said, pointing out that an autopsy report had found 23 injuries on Jespersen's decapitated body and seven on that of Ueland.

Ejjoud, an underground imam, had confessed at a previous hearing to beheading one of the women and Younes Ouaziyad, a 27-year-old carpenter, the other, while Rachid Afatti, 33, had videoed the murders on his mobile phone.

The defence team argued there were 'mitigating circumstances on account of their precarious social conditions and psychological disequilibrium'.

Coming from modest backgrounds, with a 'very low' level of education, the defendants lived for the most part in low-income areas of Marrakesh.

Jespersen's lawyers have accused authorities of having failed to monitor the activities of some of the suspects before the murders.