Tunisia and Libya announced Thursday they had agreed to share responsibility for providing shelter for hundreds of migrants stranded at their border, many of them for over a month.
The migrants, primarily from sub-Saharan African countries, had been driven to the desert area of Ras Jedir by Tunisian authorities and left there to fend for themselves, according to witnesses, rights groups and UN agencies.
Aid groups said three groups of about 300 migrants in total remain stranded there.
A spokesman for Tunisia's interior ministry, Faker Bouzghaya, said during a joint meeting with Libyan authorities in Tunis that "we have agreed to share the groups of migrants who are at the border".
"Tunisia will take charge of a group of 76 men, 42 women and eight children," Bouzghaya told AFP.
He said the groups were transferred on Wednesday to reception centres in the cities of Tatouine and Medenine and provided with health and psychological care, with the help of the Tunisian Red Crescent.
Under the agreement, Libya will take charge of the remaining 150 migrants, humanitarian sources said.
The Libyan interior ministry earlier on Thursday announced the bilateral agreement to "put an end to the crisis of irregular migrants stranded in the border area".
Racial tensions had flared in Tunisia's second city of Sfax after the July 3 killing of a Tunisian man following an altercation with migrants.
Up to 1,200 black Africans were "expelled, or forcibly transferred by Tunisian security forces" to desert border regions with Libya and Algeria, Human Rights Watch said.
Humanitarian officials have reported at least 25 deaths of migrants abandoned in the Tunisian-Libyan border area since last month.
Mediterranean Sea crossing attempts from Tunisia had multiplied in March and April following a incendiary speech by President Kais Saied who had alleged that "hordes" of irregular migrants were causing crime and posing a demographic threat to the mainly Arab country.
Xenophobic attacks targeting black African migrants and students have increased across the country since Saied's February remarks, and many migrants have lost jobs and housing.
The two North African countries are major gateways for migrants and asylum seekers attempting perilous voyages in often rickety boats in the hopes of a better life in Europe.
At least 11 migrants died in a shipwreck off the coast of Sfax, local court spokesman Faouzi Masmoudi said on Monday, adding that another 44 were missing and only two were rescued.
The distance between Sfax and Italy's Lampedusa island is only about 130 kilometres (80 miles).
But the United Nations has described the central Mediterranean migration route as the world's deadliest, claiming hundreds of lives each year.
More than 1,800 people have died attempting the route so far this year, according to figures released Friday by the International Organization for Migration.