A Kenyan court ruled on Thursday (9 February) that the government must not close the world's largest refugee camp. If closed, the Dagahaley refugee camp in Dadaab, situated northeast of the capital Nairobi near the Somali border, would result in over 200,000 people having to return to war-torn Somalia. The court's decision has eased pressure on Somalis, who feared the camp would close by the end of May 2017.

Aerial view of makeshift shelters at the Dagahaley camp in Dadaab on 3 April 2011 Thomas Mukoya/Reuters

Rights groups Amnesty International, Kituo cha Sheria and the Kenyan National Commission on Human Rights had challenged the government's order to close the camp, which has operated for more than a quarter of a century.

Judge John Mativo said Kenya's internal security minister had abused his power by ordering the closure of Dadaab camp, adding that the minister and other officials had "acted in excess and in abuse of their power, in violation of the rule of law and in contravention of their oaths of office". The judge called the order discriminatory, saying it went against the Kenyan constitution as well as international treaties that protect refugees against being returned to a conflict zone.

Kenya's government quickly said it will appeal the ruling. "Being a government whose cardinal responsibility is first to Kenyans, we feel this decision should be revoked," spokesman Eric Kiraithe told the Associated Press. The judge called the order to shut down the government's refugee department "null and void" stating that President Uhuru Kenyatta's administration had not proved that Somalia is safe to return to.

Said Abuka, a community leader in Nairobi and a refugee for 22 years, said the court ruling would help the Somali refugees. Newborn babies could not be registered as refugees because of the closure of Kenya's refugee department, he said. "After months of anxiety because of the camp closure deadline hanging over their heads, increasingly restricted asylum options and the recent US administration suspension of refugee resettlement, the court's judgment offers Somali refugees a hope that they may still have a choice other than returning to insecure and drought-ridden Somalia," said Laetitia Bader, Africa researcher at Human Rights Watch.

US President Donald Trump's temporary ban on travel from seven majority Muslim countries, including Somalia, had put added pressure on the Dadaab refugees. Last weekend, roughly 140 of the Somali refugees who had been on the brink of resettling in the United States were sent back to Dadaab instead.

Somalia remains under threat of attacks from homegrown extremist group al-Shabaab. Some Kenyan officials have argued that the sprawling refugee camp near the border with Somalia has been used as a recruiting ground for the militant group, and a base for launching attacks inside Kenya. However, Kenyan officials have not provided conclusive proof of this.

Al-Shabaab has carried out several attacks on Kenya, which sent troops to Somalia in 2011 to fight the militants. The attacks include the September 2013 armed siege on Westgate mall that killed 67 people and the 2015 attack on Garissa University that killed 148 people, mostly students.

Visit the IBTimes UK Pictures page to see our latest picture galleries.