Seven Moroccan migrants were found dead on Saturday off Morocco's Atlantic coast near Casablanca after their boat capsized, the Interior Ministry said.
Three others were taken unconscious to the hospital, while search operations are ongoing, the ministry said in a statement.
The incident reflects a growing trend in illegal migration to Spain from the Atlantic coast following a government crackdown on Mediterranean routes.
Morocco is only 14 kilometres south of the Spanish coast at the strait of Gibraltar and shares land borders with the small Spanish enclaves of Melilla and Ceuta on its Mediterranean coast.
Moroccan authorities say they have stopped 57,000 migrants from illegally crossing to Spain between January 1 and September 1.
Figures released by the International Organisation for Migration show arrivals to Spain by sea more than halved to 16,894 from January 1 to September 18, compared with 34,238 in the same period last year.
The Spanish government last month approved $35.2 million in aid to Morocco to combat illegal migration. The European Union has also promised 140 million euros in border management aid.
The incident reflects a growing trend in illegal migration to Spain from the Atlantic coast.