South African President Thabo Mbeki urged fellow Africans on Thursday to "do everything possible" to support independence for the Western Sahara after his government recognised the Sahrawi Arab Democratic Republic.
The move caused a diplomatic spat with Morocco, which annexed the territory after Spanish colonists withdrew in 1975 and which responded by recalling its ambassador from Pretoria.
"It is a matter of great shame and regret to all of us that nevertheless the issue of self-determination for the people of Western Sahara remains unresolved," Mbeki said in his address at the opening of the Pan-African Parliament in Midrand, halfway between Johannesburg and Pretoria.
"This presents all of us with the challenge to ensure that we do everything possible to ensure that these sister people also enjoy this fundamental and inalienable right, whose defence by the entirety of our continent brought us our own freedom," he said.
Foreign Minister Nkosazana Dlamini-Zuma announced in parliament in Cape Town on Wednesday that South Africa was extending diplomatic recognition to the pro-independence government of the self-proclaimed Sahrawi Arab Democratic Republic.
But Rabat condemned the decision as "partial, surprising and inopportune", and voiced its "disappointment with the new foreign policy of the South African government," in a statement issued by the Moroccan foreign ministry.
Morocco annexed the Western Sahara region in 1975, triggering a dispute with Algeria which backed the Polisario Front movement seeking independence for the territory bordering the Atlantic between Mauritania and Morocco.
South Africa has been a traditional backer of the Polisario Front, the armed wing of the Sahrawi movement, whose state proclaimed in 1976 was recognised by the Organisation of African Unity - now the African Union - but not the United Nations.
The African National Congress that swept to power in South Africa in 1994 has repeatedly pointed to the Western Sahara as the only region in Africa that had yet to be "liberated".
South African officials, speaking on condition of anonymity in Pretoria, said the decision to announce the formal recognition was prompted by the Western Sahara sending members to the opening of the Pan-African Parliament (PAP) on Thursday.
The head of the Sahrawi Arab Democratic Republic's delegation to the Pan-African Parliament said that South Africa's decision to extend recognition would have an impact.
"This decision confirms our international legitimacy and strengthens the legitimacy of our struggle for independence," said Ouadadi Cheikh Ahmed el-Hiba.
He said that as an African heavyweight, South Africa was in a position to nudge Morocco into accepting independence for Western Sahara.
"South Africa chose the right time to nudge Morocco or rather to tell it directly to allow the Sahrawi people to enjoy self-rule," he said.
The South African move came after UN envoy and former US secretary of state James Baker resigned in June after years of effort to try to settle the dispute over the status of the territory.
Baker had proposed holding a referendum on self-determination as part of a plan that won UN backing in July 2003 but Morocco has balked at the idea, stating that its security could be at risk.