The bodies of Danish tourist Louisa Vesterager Jespersen, 24, and 28-year-old Maren Ueland, from Norway, were found on December 17 last year.
On Thursday, three men admitted to carrying out the sickening killings, saying they murdered the pair after trying and failing to join ISIS.
Louisa and Maren’s remains were discovered near the popular hiking village of Imlil in the Atlas Mountains close to Marrakech.
In a court hearing in Sale near the Morrocan capital Raba, Abdessamad Ejjoud and Youness Ouziyad admitted attacking and decapitating the two young women, who had been camping in the mountains overnight.
A third suspect, Rachid Afatti, said he filmed the slaughter, a video of which Ejjoud said was shared with other Islamic State sympathisers.
Ejjoud, 33, told the court: “After failing to join Islamic State, we decided to do Jihad at home.”
The carpenter and dad-of-two, who had previously spent two years in jail on terrorism-related charges, claimed he was trying to come to terms with what he had done.
“I regret what happened and I am still trying to grasp it,” he said.
Authorities in Morocco have arrested a further 21 people who they say have links with the three.
“I regret what happened and I am still trying to grasp it”
They face charges including forming a criminal gang to commit terrorist acts, encouraging terrorism, and undermining public order.
All three on trial were arrested at a bus station in Marrakech four days after the gruesome murder.
After they were arrested, authorities described them as “lone wolves” with no connection to Islamic State.
Prosecutors say they were trying to join jihadi groups in the Sahel via the Algerian border.
The lawyer representing Jespersen’s family said Morocco should pay compensation to them.
State lawyer Abdellatif Ouahbi called the crime “an isolated regrettable act,” saying in a statement his country was “a model in counter-terrorism”.
According to Moroccan officials, some 1,700 people in the country have signed up to ISIS.
In 2017 and 2018, authorities in the country said they had dismantled 20 militant terror cells in Morocco.