Boosted by Western support, Morocco is working to impose its own settlement in the long-running Western Sahara conflict, even at the cost of a falling out with its allies, analysts say.
Morocco and the Polisario Front, an independence movement backed by the kingdom's arch-rival Algeria, have been locked for decades in a bitter struggle over Western Sahara.
The monarchy sees the former Spanish colony as an integral part of its territory, with King Mohammed declaring in November that "Moroccan sovereignty over Western Sahara will never be up for negotiation".
This unbending stance appears to have paid off, with Germany and Spain coming out in favour of Rabat's 2007 "autonomy" plan to keep the phosphate-rich desert under Moroccan sovereignty.
Spanish Foreign Minister Jose Manuel Albares is expected in Rabat on Friday to relaunch bilateral relations after Madrid, dramatically reversing decades of policy, backed the plan in what Moroccans hailed as a "diplomatic coup".
"There is a consensus on the question of the Sahara. The whole of (Moroccan) society supports the cause, it's an absolute priority for every Moroccan," said Tajeddine Houssaini, professor of international relations at Rabat's Mohammed V University.
Western Sahara, with rich Atlantic fishing waters and access to key markets in West Africa, is 80 percent controlled by Morocco but considered a "non-autonomous territory" by the UN.
Spain withdrew in 1975 but the Polisario waged a long armed struggle for independence from Morocco before reaching a ceasefire in 1991 on the promise of an independence referendum.
The Polisario in November 2020 declared the ceasefire null and void, and has since stepped up attacks on Moroccan forces.
Madrid, whose enclaves of Ceuta and Melilla share land borders with Morocco, now officially sees the autonomy plan as "the most serious, realistic and credible basis" for a resolution.
Prime Minister Pedro Sanchez has defended the shift as necessary to forge "more solid" ties with Morocco, after a string of crises over migrants and relations with the Polisario.
The move "is undoubtedly a victory for Morocco in the short term", said Bernabe Lopez, professor of Arab and Islamic studies at Madrid's UAM university.
But he added that it was "difficult to know" if the shift would have a concrete effect.
"We will have to see if there is a good agreement in the future (between Madrid and Rabat) and if this brings other countries around" to Madrid's position, he said.
Former US president Donald Trump's recognition of Moroccan sovereignty over the territory in late 2020 marked a shift on which Rabat has been quick to capitalise -- and one that Trump's successor Joe Biden has not reversed.
US Secretary of State Antony Blinken, visiting Morocco this week, also described the autonomy plan as "serious, credible and realistic".
'Rapprochement with Russia'
Moroccan Foreign Minister Nasser Bourita urged European states on Tuesday to follow Spain's lead and "get out of this comfort zone where people are just supporting a process (without) supporting a solution".
King Mohammed in November warned countries with "vague or ambivalent positions" that Morocco "will not engage with them in any economic or commercial process that would exclude the Moroccan Sahara".
Political scientist Khadija Mohsen-Finan said Morocco's latest push was "taking place at a time when all eyes are on Ukraine".
She said Morocco was making itself "indispensable" to the West by leveraging "migration, airspace, security and the fight against Islamism".
The UN recently appointed a new envoy on the conflict, raising hopes of reviving a dialogue frozen since 2019 -- despite a particularly bitter period in relations between Algeria and Morocco.
Morocco has carefully steered clear of taking sides in the ongoing war in Ukraine, abstaining from voting on UN resolutions condemning Russia for invading its neighbour.
Observers say this neutrality illustrates Rabat's desire to avoid alienating the UN Security Council member, which could impact the Western Sahara question.
But a Western diplomat, who asked not to be named, said Morocco's position had "greatly disappointed" its traditional allies "in view of the seriousness of Russian aggression and in respect of its traditional alliances with Western countries".
Instead, the diplomat said, Rabat had taken those ties as a given and sought "a rapprochement with Russia".