Spain declared a migration emergency after 2,200 migrants reached the Canary Islands in two days following a surge from sub-Saharan Africa.