Spain's parliament backed a law on Thursday granting citizenship to tens of thousands of Western Saharans who were born when Spain ran the disputed territory, which is now largely controlled by Morocco.

The text grants Spanish nationality to Sahrawis born before 29 September 1977 and to their children through a certificate of naturalisation, considering that date the effective end of decolonisation. This also applies to those who do not legally reside in Spain.

Although the exact number of beneficiaries is unknown, around 80,000 Sahrawis are believed to be eligible, with some estimates reaching almost 200,000 including the descendants.

The law passed by 168 votes to 31 despite the People's Party (Spain's main centre-right opposition party) abstaining, and the far-right party Vox voting against it. Both parties had originally supported the bill in its early stages — at a time when the governing Socialist Party itself was reluctant to move it forward.

The Catalan pro-independence party Junts also abstained. The law will now have to be approved by the Senate before receiving final approval, at which point beneficiaries will have three years from its official publication to apply for nationality.