Peter Edialu, Godspower Friday and Bayo Segun were released by an Ikeja High Court on Monday.
The men were facing charges bordering on sexual assault.
They were first arrested and charged in 2018, 2019 and 2019 respectively.
Justice Oyindamola Ogala told the court that after careful considerations of the motion papers before court, the court believed that it is in the interest of justice.
She, therefore, gave her separate judgements in the cases regarding the applicant defendants.
Ogala said: “The applicants should be released and diacharged forthwith if there are no pending matters in other courts.”
Mr Ben Abraham, the Founder of Zarephath Aid, an Non-Governmental Organisation, the counsel to the applicants, while moving for the terms of motion dated Sept. 15 for the release of the applicant as stated in paragraph A, B and C in the motion papers.
Abraham, however, withdrew paragraph 4(b) and (e) requesting the Attorney General of Lagos State and the Commissioner of Police to settle the applicant with N5 million.
“The High Court here in Lagos granted the enforcement of the fundamental rights of these three applicants which we brought before the courts.
“They have been in detention for about six years. The oldest of them has been in Kirikiri correctional medium custodial center since 2018.
“For sexual offenses, they were awaiting the Department of Public Prosecutions advice since then, but nothing since then.
“When we got to the custodial centre and saw their plight, they were not even before any courts or having the opportunity to defend themselves. So we picked up their cases earlier this year.
“Today, the court upheld our submissions and application and directed that they be immediately and unconditionally released from custody after about six years without trial,” he said.
Abraham added that these cases were just a few of the very sad and unfortunate set of circumstances facing the judicial system.
The applicants had sued the Attorney-General of Lagos State, the Lagos State Commissioner of Police, and the correctional services.
The state prosecution, representing the first respondent in the matter did not object to the motion papers.