“This morning, (the prisoner) at Oujda prison committed suicide,” the General Directorate for Prisons said in a statement.
He had used a piece of cloth ripped from his clothes and tied it to the window, it added.
Prosecutors and the inmate’s family had been immediately informed, it said.
Four defendants were sentenced to death in October 2019 for the brutal murders the previous December of 24-year-old Dane Louisa Vesterager Jespersen and 28-year-old Norwegian Maren Ueland in the High Atlas mountains, a case that shocked all three countries.
A prison official confirmed that the man who killed himself was Abderrahim Khayali, 36, who was arrested in Marrakech hours after the women’s bodies were found.
He had left the other men before they murdered the women, and later told the court that he had left out of “regret”.
But he was found guilty of trying to help the men flee.
Khayali had also appeared alongside the killers in a video in which all four pledged allegiance to the Islamic State group.
He was originally sentenced to life in prison but the sentence was changed to execution after he appealed.
Although the death penalty remains legal in Morocco, there have been no executions there since 1993 because of a moratorium, and the issue of capital punishment is a matter of political debate.
Morocco has been largely spared deadly jihadist acts since attacks in Casablanca that killed 33 people in 2003 and one in Marrakesh in 2011 that left 17 people dead.