Morocco and Spain pledged on Wednesday to cooperate more closely to curb illegal migration, an issue fueling the growth of far right and populist politics in Europe, following a near halving of migrant arrivals in mainland Spain this year from 2018.