Four African migrants drowned and 34 were rescued after their boat sank in the Mediterranean on Wednesday, Moroccan authorities said.
The Mediterranean between Morocco and Spain was a major route around 10 years ago for migrants from Africa trying to reach Europe, but numbers fell after the two kingdoms tightened control.
Moroccan authorities said the group was on an inflatable boat off the northern city of Al-Hoceima, a statement carried by state news agency MAP said.
It was unclear if the boat was heading to Spain or to one of the Spanish enclaves, Ceuta and Melilla, on the Moroccan coast.
Morocco said an investigation was still underway.
Hundreds of African migrants try regularly to enter the two enclaves either by swimming along the coast or climbing the triple walls that separate them from Morocco.
In 2015, 3,845 migrants entered Spain via sea crossings, according to the International Organization for Migration, a tiny fraction of the 956,000 that reached the rest of Europe the same way.