The EU's top court on Wednesday cancelled two trade deals with Morocco, for agricultural products and fish from disputed Western Sahara, after a case brought by the Polisaro independence movement.
The court "annuls the (European) Council decisions concerning, first, the agreement between the European Union and Morocco amending the tariff preferences granted by the European Union to products of Moroccan origin and, second, the Sustainable Fisheries Partnership Agreement," the EU's Court of Justice said in a statement.
The accords will remain in place for two months in order to "preserve the European Union’s external action and legal certainty over its international commitments", it said.
Morocco views Western Sahara as an integral part of its territory, but the UN views the former Spanish colony as a "non-autonomous territory" and the Polisario, backed by Algeria, has long sought its independence.
Morocco controls around 80 percent of the territory and has offered autonomy, while insisting it must retain sovereignty.
At stake are an overland route to West African markets, rich phosphate resources and Atlantic fisheries along the territory's 1,100-kilometre (680-mile) coastline.
The EU court in Luxembourg ruled that by extending trade deals with Morocco southwards into the former Spanish colony "without the consent of the people of Western Sahara, the Council infringed the European Union’s obligations in the context of its relations with Morocco under EU and international law".
After the court ruling, Morocco and the European Union issuing a joint statement underlining that their trade partnership would continue.
"We will take the necessary measure to ensure a legal framework that guarantees the continuation and stability of trade relations between the EU and the Kingdom of Morocco," the bloc's top diplomat, Josep Borrell, and Moroccan Foreign Minister Nasser Bourita said.