On June 24, authorities arrested some 2,000 migrants, mostly from Sudan, who tried to breach the frontier with the enclave of Melilla in order to reach Europe. At least 23 migrants died in a crush.
"Eighteen migrants arrested on June 24 were sentenced to three years in prison" by the appeals court in Nador, a town near the border with Melilla, defense lawyer Mbarek Bouirig told AFP late Thursday.
The 18 migrants — among more than 60 arrested following the Melilla tragedy — had initially been sentenced to 11 months in prison.
The Moroccan Association of Human Rights denounced the ruling in a tweet, blasting what it described as a "repressive judicial system."
The migrants had been convicted of "illegal entry into Morocco", "violence against law enforcement officers", "armed gathering" and "refusal to comply".
Spanish enclaves Melilla and Ceuta have long attracted people fleeing violence and poverty across Africa and seeking refuge via the continent's only land borders with the EU.
Since the June 24 incident, dozens of mostly Sudanese migrants have been sentenced to prison terms ranging from eight months to two years in prison without parole.