Territorial disputes , despite their drama , are subordinate to the continuing and productive economic cooperation between both countries , there is also shared interests in counterterrorism , counternarcotics , and efforts to stem illegal immigration . Morocco notably assisted Spanish authorities in the investigation of the 2004 bombings in Madrid and this relationship continues . Moroccan soldiers have served under Spanish command in the United Nations Stabilization Mission in Haiti and Moroccan gendarmes have joined Spanish patrols to combat illegal immigration in the Strait of Gibraltar
2004 bombings in Madrid
2004 Madrid train bombings
Morocco–Spain relations