Spain and Mauritania have agreed to tighten their borders to deter thousands of migrants from Africa trying to enter Europe.
Hundreds of African immigrants have been detained off the Canaries
The agreement follows talks in Mauritania between officials from both countries and the European Commission.
Hundreds of Africans have been detained in recent weeks as they attempted the perilous journey to the Canary Islands.
The Mauritanian Red Crescent believes more than 1,000 would-be migrants have died in the past five months.
More than 900 have reached the Canaries since Saturday.
The Mauritanian prime minister appealed for international help earlier this week, saying one country alone could not withstand the pressure.
Spanish authorities say Mauritania has become a new launching point for illegal journeys to Spain, after Morocco stepped up its security.
Spain has offered Mauritania patrol boats to help tackle illegal boats leaving its coast and help with setting up holding camps on land.
It is also strengthening resources in the Canary Islands which has borne the brunt of recent migration bids.
Friso Roscam Abbing, spokesman for the European Commission for Justice, Freedom and Security, said the ultimate solution would be "addressing the root causes of the reasons why they do take that enormous risk and go on those unseaworthy ships".