The rebel Polisario Front said that the decision was a victory.
The EU's top court has cancelled two agriculture and fishing agreements between the bloc and Morocco, which allow the country to export goods produced in the disputed Western Sahara territory.
The ruling sees the Polisario Front, the Saharawi people's independence movement that brought the case to the European Court of Justice, as a legal person and concludes that the EU hadn't "secured the consent of the people of the Western Sahara".
The decision could put at risk trade relations between Brussels and Rabat, but the two partners have already tried to calm any fears with a statement saying they will take the "necessary measures" to guarantee the "continuation and stability" of trade relations between the European Union and the Kingdom of Morocco.
The Polisario Front says the ruling is a victory in their fight for independence
The two agriculture and fishing agreements will stay in place for at least two more months – just enough time to appeal the ECJ's ruling.
Oubi Bouchraya, the Polisario Front representative to the EU and Europe, told Euronews that both Brussels and Rabat should not seek to just try and replicate the same agreement again.
"If the European Union reproduces, for example, the same scheme of the past and decides to introduce an appeal against today's decisions, this would also be a bad message for Morocco, which can be interpreted as a carte blanche to carry out the policies that we all know and which have led not only to the failure of the peace process in Western Sahara, but also brought the entire region to the brink of collapse," Bouchraya said.
The Western Sahara is a disputed territory located in southern Morocco. The former Spanish colony is considered by Rabat as part of its own country.