MADRID — The authorities in Spain and Morocco extended a search-and-rescue operation at sea on Sunday after recovering the bodies of at least 20 African migrants a day earlier off Melilla, a Spanish enclave in northern Africa.

Most of the bodies, spotted on Saturday by a Spanish passenger boat that had sailed out of Melilla, were recovered by the Moroccan authorities. One was found in a separate location by a Spanish police boat and was taken to Melilla, where an autopsy was to be performed.

Rescue boats began patrolling “a wider radius” on Sunday with the support of a Spanish police helicopter, said Irene Flores, a spokeswoman for the Spanish government in Melilla, amid fears that the strong winds and currents that made the seas dangerous in the past few days would lead the bodies to drift farther.

The authorities have not been able to determine exactly when the tragedy occurred, Ms. Flores said, nor do they know the exact route the migrants were following. Melilla, an enclave of about seven square miles, is roughly 100 miles from the Spanish mainland and attracts many seeking the promise of life in Europe.