She said that the government ought to follow the law on repatriation to the letter and ensure that human rights and dignity are central to the whole exercise.
The Judge was of the view that a refugee has rights that are equal to those enjoyed by Kenyans in terms of security and to be informed beforehand about an action to be taken to their detriment.
"The refugees and asylum seekers in the two camps enjoy the rights available to them in the camps including the right to protection and security," Justice Thande noted.
Adding that, "The intended closure of the certainly poses a real threat and apprehension in the minds of those who have been granted refuge therein, including the threat to involuntary repatriation,".
At the same time the court noted that the closure of refugees camps has huge implications on the lives of those living in them and cannot be done from a corner office.
She asserted that it must consult refugees and asylum seekers and have them as part of the working group or committees that would come up with the roadmap to close them.
Justice Thande said the Cabinet Secretary ought to notify the public, give reasons for closure, specify timelines and give an appeal mechanism for anyone who is aggrieved.
"The intended closure of the Refugee camps in question has far-reaching implications and consequences. As such, the same cannot be done with a stroke of a pen," she said.
Pointing out, "The views and input of those affected or likely to be affected by the closure of the Camps must be considered and taken into account before such a drastic action is taken,".
Former President Uhuru Kenyatta's administration had twice attempted to close down both the Dadaab and Kakuma refugee camps where the majority of refugees from Somalia, South Sudan and the Democratic Republic of Congo (DRC) reside.
The Kenyan government cited security, environmental and economic burdens as the reason for its decision to close refugee camps.
An initial deadline of June 2022 for the closure of Dadaab caused anxiety amongst the refugees and the international community, which opposed the move on humanitarian grounds.
The case was filed by Legal Advice Centre ( Kituo Cha Sheria), Kashindi Thomas Debora, Solomon Gichira, Maina Nyabuti, Brian Onyango and Clinton Nyamongo.
In the case, the court heard that Kashindi was a Congolese national who was living in Kakuma.
Stay informed. Subscribe to our newsletter
Kashindi narrated that the ran away from South Kivu in the Democratic Republic of Congo following conflicts in her country in 2014 and has since been residing in Kakuma Refugee Camp.
She told the court that following a meeting between the government and United Nations High Commissioner for Refugees (UNHCR), it announced that the camp would be closed by June 30, 2022.
Kashindi lamented that the directive was issued without public participation, consultation or stakeholder engagement, thereby violating the Constitution as well as international instruments relating to the rights of refugees.
Gichira had a separate case. He argued that the closure would negate Kenya's commitment under the various international treaties.
The government opposed the case. It argued that Kenya currently hosts more than 500,000 refugees and asylum seekers.
The majority of the refugees hosted based in the 2 Camps are from the Democratic Republic of Congo, Burundi, Somalia, Eritrea, Rwanda, Ethiopia and South Sudan
The court heard that the decision to close the camps followed various concerns raised on the state of and quality of life of the camos.
According to the government, an internal working Committee was established comprising Government officials and members of the UNHCR to develop a roadmap or strategy for the closure of the camps.
The committee then presented its report to it for further directions. The Attorney General argued that they had failed to demonstrate that the closure of the camps signified a forceful return of the refugees.