A Moroccan court sentenced to death two Dutch citizens over the accidental killing of a medical student in 2017, a lawyer for the victim's family said Saturday.

Two years ago, Edwin Gabriel Robles Martinez and Shardyone Girigorio Semerel allegedly opened fire on a cafe in the tourist hub of Marrakesh .

They had apparently been aiming at the cafe's owner, but ended up killing the student and wounding two other people, local media reported.

At the time, local officials said the shooting was a "settling of accounts" that was "directly linked to a criminal network which has ramifications in some European countries".

On Friday, a court sentenced to jail 15 other people accused in the same case, handing them terms ranging between three and 20 years for setting up a "criminal gang", lawyer Abdellatif Htitech said.

Among those convicted was the cafe's owner, who received a 15-year prison sentence for "drug trafficking", said Mr Htitech, who represents the family of the medical student.

A spokeswoman for the foreign ministry in the Netherlands said the Dutch embassy "is in direct contact with the lawyer" .

Asked if the Netherlands would intervene, Annemijn van den Broek said it was up to those convicted to decide whether or not to appeal.

She said the Netherlands was opposed to the death penalty.

Morocco – which last issued a death sentence earlier this month against three ISIS supporters over the beheadings of two Scandinavian tourists – has had a de-facto freeze on executions since 1993.

Several people were arrested in the days after the 2017 shooting.