The Federal High Court in Abuja has ordered the immediate release of the detained publisher of Sahara Reporters, Omoyele Sowore.
The court made the order after saying on Tuesday that there was no extant order allowing Mr Sowore's further detention before the court.
The court said Mr Sowore must deposit his international passport within 48 hours after his release and ordered that his lawyer, Femi Falana, should be responsible for producing him in court once he has been notified of the charge against him.
The judge, Taiwo Taiwo, said the law provides for the freedom of all Nigerians regardless of economic or political status.
"The order of court has expired. It has not been renewed and cannot be renewed in view of the motion ex-parte earlier withdrawn," the judge said.
"The liberty of all Nigerians high or low, poor or rich is guaranteed by the constitution. It's for this end that I'm of the view that the defendant ought to be released forthwith," Mr Taiwo said in a short ruling on Tuesday.
The court took made the decision after taking judicial notice of the information stating that Mr Sowore's investigation had been concluded.
Mr Sowore was arrested on August 3 for planning a nationwide protest, under the theme, #RevolutionNow.
There have been growing calls for his release after the government filed charges of treason and money laundering against him.