The European Court of Justice (ECJ) has ruled that EU agreements and treaties with Morocco cannot apply to Western Sahara, dealing a major blow to Rabat's claims to legal rights over the territory.

Western Sahara has been occupied by Morocco since its 1975 invasion of the territory after Spanish colonial control ended. It is the subject of one of the world's longest-running conflicts, between the Moroccan state and the indigenous Sahrawi.

'It cannot be held that the term 'territory of the Kingdom of Morocco'... encompasses Western Sahara' -ECJ

Wednesday's ruling addressed a case filed by the Polisario Front, the de facto government of the Sahrawi people in the Western Sahara refugee camps in Tindouf, challenging the status of two trade deals between Morocco and the EU.

The ECJ ruled that both the 2012 EU-Morocco free trade agreement, and the 2000 EU-Morocco Association Agreement remain valid, rejecting the case as inadmissible on the grounds that trade deals with Morocco are not applicable to Western Sahara and thereby nullifying the Polisario's interest in the case.

In its judgment, the court broke from its previous policy of avoiding ruling on the legal status of Western Sahara by recognising the “separate and distinct status guaranteed to the territory of Western Sahara under the Charter of the United Nations”.

“It cannot be held that the term ‘territory of the Kingdom of Morocco’, which defines the territorial scope of the Association and Liberalisation Agreements, encompasses Western Sahara,” the ECJ said in a statement after the ruling.

The court's decision extends a string of recent diplomatic victories for Sahrawi representatives that began in December 2015 when a lower European court annulled trade agreements between the EU and Morocco that applied to Western Sahara.

“EU complicity in the exploitation of Western Sahara's natural resources is a violation of international law, an obstacle to the peaceful resolution to the conflict, and a stain on the EU's reputation,” said Mohamed Sidati, the Polisario's envoy in Europe.

He added that he welcomes the court's decision as a positive step.

“The ruling confirms the long-established legal status of Western Sahara as a non-self-governing territory, and upholds existing international law, in particular the International Court of Justice Advisory Opinion of 1975,” Sidati said.

Prior to Wednesday's ruling, the ECJ's advocate-general, Melchior Wathelet, had published a legal opinion on Western Sahara's status on 13 September, finding that it could not be considered Moroccan territory.

In March, the Moroccan government was involved in a diplomatic dispute with the United Nations after Rabat ejected the 73 staffers of the UN mission in Western Sahara (MINURSO) in response to UN Secretary-General Ban Ki Moon's use of the word "occupation" to refer to Morocco's annexation of the area.

“The ECJ ruling is clear: EU member states and institutions must now immediately halt all agreements and projects with Morocco in Western Sahara,” said Carne Ross, the founder of the consulting firm Independent Diplomat, which represents the Polisario.

Despite the ruling, non-EU member states and some private companies are still seeking Moroccan approval for projects in Western Sahara. The government of Nigeria is currently negotiating a deal with Morocco for a natural gas pipeline that would pass through the territory.

Under Moroccan administration, Western Sahara has become synonymous with human rights abuses and political repression. The territory is ranked by Freedom House alongside North Korea and Saudi Arabia as one of the least free places in the world.

Morocco's foreign minister, Salaheddine Mezouar, and the EU high representative for foreign affairs, Federica Mogherini, responded jointly to the decision, underlining the “privileged partnership” between the EU and Morocco.

“Both sides will examine all possible implications of the court's judgment and will work together on any issue relating to its application,” a statement issued by both parties read. Representatives of the Moroccan government did not respond to separate requests for comment at the time of publishing.

Major setback to kingdom

“It's another symbolic win for Polisario, another reaffirmation by a international legal body of Western Sahara's legal status as an occupied colony, and hence the illegitimacy of Moroccan claims of having sovereignty over it,” said Jacob Mundy, professor of peace and conflict studies at Colgate University.

However, Mundy also underlined that the ECJ's ruling will have little chance of moving the Western Sahara conflict towards a resolution.

“On the ground, I don't expect much to change. Morocco will obviously unleash a firestorm of diplomatic fury, and the Moroccan press will follow suit. Perhaps we can expect some activism on Rabat's [behalf] from Madrid and Paris, but that remains to be seen,” he told MEE.

Stephen Zunes, professor of politics and international studies at the University of San Francisco, said the ruling confirmed long-standing international consensus on Western Sahara's legal status and the opposition of the Sahrawi people to Moroccan takeover.

"As with the last year’s EU decision that products from Israeli settlements in the occupied West Bank could no longer be labelled as being 'made in Israel', products from the occupied Western Sahara can no longer be labelled as 'Made in Morocco'," Zunes told MEE.

He added that Morocco had hoped that the deals with the EU would serve as a legal precedent in recognising Morocco's "illegal annexation" of Western Sahara.

"This ruling therefore constitutes a major setback to the kingdom’s efforts to legitimise its occupation," Zunes said.