A.M., a juvenile, filed an emergency petition for a writ of habeas corpus seeking his release from secure detention. We remand for further proceedings consistent with this opinion.
A.M. was charged with aggravated assault with a firearm and obstruction by resisting a police officer without violence. The State alleged that A.M. and an armed co-respondent drove to the victim’s home and confronted the victim in an attempt to obtain a Sony Playstation the victim had allegedly stolen from A.M. The trial court initially placed A.M. in secure detention, and over A.M.’s objection, at a hearing on May 27, 2009, continued A.M.’s placement in secure detention.
In this petition, A.M. argues that the risk assessment instrument (“RAI”) used by the trial court impermissibly added three points for the possession of a firearm by way of double scoring, and that in the absence of written clear and convincing reasons for A.M.’s continued secure detention, A.M. must be discharged. In its response, the State appears to concede that the RAI score of 13 — indicating secure detention — is incorrect, and is more appropriately scored as 10 — indicating that non-secure or home detention is the appropriate placement for A.M. However, the State contends that the correct RAI score of 10 is irrelevant, and that A.M.’s continued secure detention is legal, based upon the involvement of a firearm.
The State relies on section 985.255(l)(f), Florida Statutes (2008), which provides that a child’s continued secure detention is appropriate where:
The child is charged with a capital felony, a life felony, a felony of the first degree, a felony of the second degree that does not involve a violation of chapter 893, or a felony of the third degree that is also a crime of violence, including any such offense involving the use or possession of a firearm.
While this is true, the statute also provides that where a juvenile is detained pursuant to section 985.255(1), at the mandatory detention hearing where the need for continued detention is determined: “Unless a child is detained under paragraph (l)(d) or paragraph (l)(e), the court shall use the results of the risk assessment performed by the juvenile probation officer and, based on the criteria in subsection (1), shall determine the need for continued detention.” § 985.255(3)(a), Fla. Stat. (2008) (emphasis added).
A.M. was not detained under paragraph (l)(d) or paragraph (l)(e) of section 985.255, he was detained under paragraph (l)(f). Therefore, according to the unambiguous language of the statute quoted above, the trial court was required to use the results of A.M.’s RAI in determining whether A.M. should continue in secure detention. Furthermore, as the State has apparently conceded, A.M.’s RAI was incorrectly scored, and should have been 10 — indicating non-secure or home detention.
However, paragraph (3)(a) does not end this Court’s analysis. Section 985.255 provides a legal basis for the continued secure detention of a respondent in A.M.’s situation: “If the court orders a placement more restrictive than indicated by the results of the risk assessment instrument, the court shall state, in writing, clear and convincing reasons for such placement.” § 985.255(3)(b), Fla. Stat. (2008). Perhaps *504in reliance upon the improperly scored RAI, the trial court did not provide clear and convincing written reasons for the continued secure detention of A.M.
Accordingly, based upon the statutory authority detailed above, and based upon what appears to be an incorrect RAI, we remand this case to the trial court with instructions to either immediately release A.M. from secure detention, or provide, in writing, clear and convincing reasons for A.M.’s continued secure detention. See T.S. v. Clemons, 770 So.2d 197, 200 (Fla. 2d DCA 2000).
This opinion shall take effect immediately, notwithstanding the filing of any motion for rehearing.
Remanded.