The High Court has quashed government's plan to close the Dadaab refugee camp.
Justice John Mativo on Thursday ruled that Interior Cabinet Secretary Joseph Nkaissery and Principal Secretary Kibicho acted beyond their powers in issuing the directive to close the camp
The court declared the repatriation of refugees unconstitutional and discriminative, declaring as null and void notices published in the Kenya Gazette announcing the repatriation of refugees.
The judge also directed the State to put into place mechanisms that ensure the Department of Refugees is functional.
The Kenya National Commission on Human Rights and Kituo cha Sheri filed the suit last year after the government said the camp would be closed down and refugees repatriated to their native countries.
Amnesty International was an interested party in the case.
The activists argued that Kenya has an obligation under international laws to protect the rights of refugees and asylum seekers.
The directive to close the camp was issued on May 6 and 10, 2016 over concerns of national interest on security of the country. The camp was set for closure November last year.
The lobbies had argued that the directive was a blanket one, arbitrary, discriminative and contrary to international laws.
At one time, the court summoned the PS, Karanja Kibicho to appear in person to explain the government's position on the matter.
He told court that the decision had been reached as a measure to protect the country from security threats from Al-Shabaab, who get into the country from neighbouring Somalia.
According to the government the closure of one of the world's largest refugee camps and repatriation of refugees would be done in a humane manner.