Children walk together amongst makeshift homes, or "tukuls", in the outskirts of Dagahaley settlement at Kenya's Dadaab Refugee Camp on 31 August 2011 Jonathan Ernst/Reuters

Rights and aid organisations have welcomed Kenya's high court ruling stopping the government from closing Dadaab, the world's largest refugee camp, but warned that the African nation and the international community must work towards finding alternative solutions for refugees.

The 8 February ruling came in response to a petition by two Kenyan human rights organisations which challenged the constitutionality of the government's order to unilaterally shut down the sprawling Dadaab facility largely populated by 260,000 Somali refugees, and the now-disbanded Department of Refugee Affairs.

The camp was initially due to be closed on 30 November 2016, but the government said it would delay its decision to close the camp until the end of May 2017 on "humanitarian grounds". A quarter of a million refugees had faced being forcefully returned to war-torn Somalia, where they would have been at serious risk of human rights abuses.

The Norwegian Refugee Council, said there was an urgent need for Dadaab to remain open, "as the current drought and food crisis is devastating parts of Somalia and the prospects for a safe return of Somali refugees from Kenya is drastically diminished".

Rights groups hailed the court ruling as historic but highlighted the need for durable solutions for Somali refugees in Kenya.

"The court's decision today is a sound one, but it does not resolve the future of Somali refugees in Dadaab, which, in its current state, is not a sustainable solution. We now need to talk about a way forward, beyond the status quo in Dadaab for Somali refugees, that focuses on long-term solutions – whether it is being self-reliant and able to integrate in Kenya, fully voluntary repatriation, or settlement in a third country," Kurt Tjossem, East Africa regional director at the International Rescue Committee (IRC), said.

Somali refugees look through the barbwire fence of a United Nations World Food Programme (WFP) distribution centre during a food distribution exercise in Dagahale, one of several refugee settlements in Dadaab on 8 October 2013 Siegfried Modola/Reuters

Referring to Uganda's "successful refugee hosting model" – where refugees are allowed to support themselves, use local health and education services, while contributing to their communities – Tjossem hoped the model would be replicated across East Africa and beyond.

"Dadaab is not designed to be the long-term situation it has now become. In fact, constant threats of closure over the years were not the only factor driving refugees' decision to head back to Somalia: decreased resources in Dadaab, including cuts in food rations and limits on freedom of movement mean that regardless of the important court decision, there will be continued pressure for refugees to return when it is not yet safe for them to do so."

Muthoni Wanyeki, Amnesty International's Regional Director for East Africa, the Horn and the Great Lakes echoed the IRC's view, saying: "Stopping the imminent closure of Dadaab refugee camp is an essential first step in respecting and protecting refugee rights in Kenya. Now Kenya and the international community must work towards finding alternative solutions for refugees including local integration options."

The Kenyan government said it will appeal against the ruling on security grounds, alleging attacks by the Somalia-based al-Shabaab group had been planned in Dadaab.