The independence movement for Western Sahara, the Polisario Front, has released 243 Moroccan prisoners of war, some of whom had been held for up to 28 years.
By Sebastian Usher
BBC North Africa correspondent
They were flown in two batches under the auspices of the International Committee of the Red Cross (ICRC) from Polisario camps in the western Algerian town of Tindouf to the southern Moroccan port of Agadir.
The Moroccans are the world's longest-serving POWs
It is the first release of Moroccan prisoners of war since the United Nations voted its support for a new plan to settle the long-running dispute over Western Sahara at the end of July.
Recently, the Polisario made a major policy switch, outflanking Morocco by accepting the UN-supported plan to resolve the dispute over Western Sahara, which has been controlled by Rabat since fighting ended in 1991.
But Morocco's continued rejection of the plan on the grounds that it might lead to the territory's independence has left it looking isolated and intransigent.
World's longest-serving POWs
The flight from Tindouf to Agadir only last 40 minutes.
But it has taken some of the Moroccan prisoners half a lifetime to make it - they are the longest serving prisoners of war in the world.
The regional head of the ICRC, Harald Schmid de Gruneck, who organised the flights, said more than 200 of the soldiers had been captive since 1979.
Mr de Gruneck said several officers had been held virtually since the war between Morocco and the Polisario first broke out in the mid-1970s.
He added that they were being handed over to the Moroccan army, which would give them a medical check-up and put them in contact with their families.
In the past two-and-a-half years, the Polisario Front has released nearly 1000 Moroccans from the prisons it maintains in Algeria, the movement's main sponsor. But 914 still remain.
The United States has called for all the prisoners to be freed, and Morocco has in the past scorned these partial releases, accusing the Polisario of exploiting the prisoners for propaganda purposes.
Many thousands of refugees still live in desert camps
Some observers have wondered why the Polisario does not just release all the prisoners in one go.
Observers say that the continuing detention by the Polisario of an ageing group of prisoners of war makes it hard for the organisation to maintain the moral high-ground.
They say that it also it weakens the case of human rights campaigners for the people of the Western Sahara, 200,000 of whom still live in refugee camps in the desert.