The bodies of 16 people have been pulled from the sea off the coast of Melilla, a small Spanish territory bordering Morocco.
Moroccan rescue services recovered the corpses after the crew of a Spanish ship spotted them in the water.
A medical official told AFP news agency all the dead were from sub-Saharan Africa, apart from one Moroccan.
It is thought they may have been hoping to reach Europe by sailing from Melilla, despite storm warnings.
Melilla, which is just 12 sq km (7 square miles), is a major crossing point for undocumented migrants seeking work or asylum in Europe.
It is one of only two EU land borders with Africa – the other being a second Spanish enclave, Ceuta.
A spokeswoman for Melilla’s authorities said earlier that “about 20” bodies had been retrieved.
The exact death toll has not yet been confirmed. Spanish rescue services resumed a search on Sunday morning.
The sea crossing between North Africa and southern Spain is increasingly favoured by migrants, according to the International Organization for Migration (IOM).
So far in 2018, Spain has been the second most popular entry point for incomers to Europe. IOM figures say some 1,279 arrived there, while 4,256 went to Italy.
Not including those recovered this weekend, at least 243 migrants have already died or gone missing this year after trying to cross the Mediterranean.