Algiers: Algeria has agreed to take in 41 Syrian refugees trapped since mid-April in a desert area that borders neighbouring Morocco, the foreign ministry said on Thursday.

The decision comes two days after the UN refugee agency said the plight of the refugees - who include a pregnant woman - was “untenable”, urging Algeria and Morocco to work for a solution.

In a statement carried by APS news agency, the foreign ministry said Algeria would take in the refugees as an “exceptional humanitarian gesture”.

It said the decision was also meant to mark the holy Muslim fasting month of Ramadan, during which the pious are urged to be charitable and devote themselves to prayer.

The refugees would be housed and fed and if they wish be reunited with family members in a third country, a ministry spokesman said in the statement carried by APS.

On Tuesday the UNHCR said “prompt” action by Morocco and Algeria was needed to facilitate “the immediate and safe passage of the 41 vulnerable Syrian refugees”.

The group trapped since April 17 included children and women, including at least one who was in need of an urgent Caesarean section, it said.

At the time, Morocco accused its neighbour of expelling the refugees to “sow trouble” and “generate an uncontrollable flow of migrants”.

Algeria “categorically” rejected the allegations as false.

It sparked a diplomatic spat, with each country summoning the other’s ambassador.

More than 40,000 refugees from Syria have settled in Algeria since the start of their country’s civil war in 2011.

Millions of Syrians have been forced to flee their homes while more than 465,000 people have been killed.

This year the number of Syrian refugees crossed the 5 million mark and aid groups have urged the international community to end the country’s six-year war and provide more assistance.

The new figures mean around a quarter of Syria’s population has fled since conflict started in 2011.

Aid groups helping Syrian refugees have regularly sounded the alarm about the crisis, appealing for more funds and international action to end Syria’s war.

Most Syrian refugees are hosted regionally, by neighbours Turkey, Lebanon and Jordan, with more in Iraq and Egypt.