They have disagreed about territories, immigration and support for rebels in the region.
But a visit by the Spanish Prime Minister Pedro Sanchez to Rabat this week is raising hopes of improved ties.
It comes less than a year since Sanchez backed Morocco’s plan to grant autonomy to the disputed Western Sahara territory.
The Polisario Separatist group, which wants an independent state in the region, has rejected that plan.
So, what would it take to solve this long-running conflict?
Presenter: Laura Kyle
Guests:
Hugh Lovatt – Senior policy fellow at the European Council on Foreign Relations
Yasmine Hasnaoui – Professor of political science at the American International University in Kuwait
Mahjoub Mleiha – Advocacy head of the Collective of Sahrawi Human Rights Defenders