
960 So.2d 793 (2007)
A.R., a juvenile, Petitioner,
v.
Dale DOBULER, Superintendent, Miami-Dade Regional Juvenile Detention Center, and The State of Florida, Respondents.
No. 3D07-1514.
District Court of Appeal of Florida, Third District.
June 18, 2007.
Bennett H. Brummer, Public Defender, and Billie Jan Goldstein, Assistant Public Defender, for petitioner.
Bill McCollum, Attorney General, and Timothy R.M. Thomas, Assistant Attorney General, for respondents.
Before GERSTEN, FLETCHER, and SUAREZ, JJ.
PER CURIAM.
A.R., a juvenile, filed a petition for writ of habeas corpus. He contends that he is being illegally detained pursuant to an order of secure detention, in violation of section 985.255(1)(a)-(j), Florida Statutes (2006). Because the trial court ordered the juvenile to remain in secure detention without providing written reasons for ordering a more restrictive placement than the risk assessment instrument indicated, we grant the petition. See § 985.255(3)(b), Fla. Stat. (2006).
To ensure that the petitioner is not improperly kept in detention, we order the trial court to either enter an order providing written reasons sufficient to comply with section 985.255(3)(b), Florida Statutes (2006), or to release A.R. from secure detention by 5 P.M. on the second business day that follows the date of this opinion. See K.M. v. Dep't of Juv. Justice, 898 So.2d 1193 (Fla. 1st DCA 2005). This opinion shall take effect immediately notwithstanding the filing of any motion for rehearing.
Petition granted.
