Migration from poorer areas to richer areas can either be managed or un-managed. After years of the latter, it looks like Spain and Senegal are going to try the former.
The deal would discourage illegal migration and give Spain the opportunity to recruit a significant number of workers, Mr Moratinos said.
More than half of the 26,000 migrants who have reached the Spanish Canary Islands this year come from Senegal.
[Spanish Foreign Minister] Moratinos also signed a co-operation deal that will give Senegal up to 15m euros (Â£10.3m) of Spanish aid annually over five years.