The High Court has ordered the government to release lawyer Miguna Miguna from detention at the Jomo Kenyatta International Airport.
Lady Justice Roselyn Aburili issued the directive after lawyers representing Dr Miguna dragged the government to court while seeking his unrestricted entry back into the country.
Consequently, Justice Aburili directed that the activist be immediately released and that he presents himself before court on Wednesday.
Lawyers John Khaminwa, Nelson Havi and Julie Soweto had sued the government over the matter.
They have also sued the officer commanding police division at JKIA and the Attorney-General.
In sworn case documents, the lawyers claimed that Dr Miguna has been held incommunicado in a toilet at Terminal 2 at Nairobi's JKIA and that his Canadian passport has been withheld.
They further argued that the sued parties have refused to comply with earlier orders issued by the court, which required them to provide him with travel documents to enable his re-entry.
"He is justifiably apprehensive following the sued parties conduct that he will be abused, tortured, mistreated and unlawfully removed from the jurisdiction in order to frustrate orders of the court," Mr Havi said.