Rescue boats, helicopters and planes from southern Spain carried out a series of rescue operations late Wednesday and Thursday, a spokeswoman said. Since Wednesday evening, 185 people in five boats had been rescued.
But at least one boat had capsized, and four migrants were already dead in the water some 40 kilometres (25 miles) off Morocco's coast when rescuers arrived, she said. Another of those rescued died later of cardiac arrest.
On Thursday, the coastguards were searching for another two boats in the Mediterranean with at least 45 people on board.
Initially, helicopters and planes had been grounded because of bad weather but they were eventually able to fly, joining rescue boats in the search.
The news came as police said they had arrested 19 people for illegally transporting migrants across the Strait of Gibraltar to Spain using jet skis or small inflatable boats.
They allegedly charged 4,000 euros ($4,900) per crossing and another 500 euros if the person trying to get to Europe needed lodging once in Spain, police said in a statement. The Guardia Civil also found several kilograms of drugs and thousands of euro in cash during a series of raids.
Spain is the third busiest gateway for migrants arriving in Europe, still far behind Italy but catching up fast with Greece.
Many Africans undertaking the long route to Europe are choosing to avoid crossing danger-ridden Libya to get to Italy along the so-called central Mediterranean route, choosing instead to get there via Morocco and Spain.
According to the International Organization for Migration, more than 22,400 people arrived in Spain by sea last year, nearly triple the number for 2016. Some 223 people died along the way.
So far this year, at least 3,778 migrants have arrived in Spain, with more than 180 losing their lives trying to cross the Mediterranean.