Of the 34 people travelling in the boat, reached by the Moroccan navy at midday on Tuesday, two children, three women and six men died and another 12 were hospitalised, a doctor in the coastal town of Hoceima told Agence France Presse.
All but one of the victims drowned, the other dying while being transported to Hoceima hospital, according to Faisal Oussard, local representative for the Moroccan Association of Human Rights.
They were all sub-Saharan migrants but their nationalities were not known.
Oussard said the boat capsized 9km off Hoceima, having set off from Nador, 130km to the east, either headed for the north African Spanish enclave of Melilla, or mainland Spain.
The sea was calm when the accident took place, but the boat, a rigid inflatable, or RIB, was far too small for the number of people it was carrying, he added.
The condition of those hospitalised in Hoceima and the fate of the 11 people who escaped without injury was not known.
The Moroccan authorities frequently expel sub-Saharan migrants across the Algerian border, which is their main point of entry.
Medical aid group Doctors Without Borders said last month that it was closing its projects in Morocco in protest at the plight of African migrants allegedly abused by Spanish and Moroccan police while trying to reach Europe.
Thousands of illegal African migrants regularly attempt to cross from Morocco into Spain each year on overcrowded and makeshift boats.
The tiny Spanish enclaves of Ceuta and Melilla, perched on the coast of north Africa and both claimed by Morocco, are key launching pads for clandestine migration to Europe.
Melilla received 2 224 illegal immigrants last year, 262 more than in 2011, according to Spain's Interior Minister Jorge Fernandez Diaz.
He blamed instability in Africa's Sahel region, and especially in Mali, for the rise in illegal immigrants trying to enter the territory.
Local associations estimate that Morocco was hosting between 20 000 and 25 000 migrants from sub-Saharan countries in 2012 hoping for access to Europe through Spain. – AFP