The state has appealed a trial court order dismissing a petition alleging that the appel-lee, C.J.A., was a delinquent child because he had committed criminal mischief. We find that the trial court erred by finding that the petition had been untimely filed and dismissing it with prejudice. We, accordingly, reverse.
On December 9, 1992, a Pasco County Deputy Sheriff interviewed the appellee about an incident involving criminal mischief. At the time of the interview, the appellee was in the Pascó County Juvenile Detention Center because of other unrelated offenses. On January 8, 1993, an affidavit setting forth probable cause that the appellee had committed criminal mischief was filed, and on January 27,1993, the state filed a petition alleging that the appellee was delinquent by reason of committing that act. The appellee filed a motion to dismiss the petition on the ground that it had not been filed within forty-five days of the date he was taken into custody. *301The trial court granted the appellee’s motion and entered an order dismissing the petition with prejudice. This timely appeal followed.
Section 39.048(6), Florida Statutes (1991), provides: “[A] petition alleging delinquency shall be dismissed with prejudice if it is not filed within 45 days after the date the child is taken into custody. The court may grant an extension of time not exceeding an additional 15 days for cause, upon motion by the state attorney.” The state does not contend that the time for filing was properly extended, but takes the position that the appellee was not taken into custody for the purpose of section 39.048(6) when he was interviewed on December 9, 1992, and therefore, the petition was filed within the forty-five day period. We agree with the state’s position.
When the deputy sheriff interviewed the appellee on December 9, 1992, the appellee was in custody at the detention center for unrelated offenses. The appellee, after having his Miranda rights read to him, agreed to speak with the deputy and confessed to the criminal mischief. The appellee was not arrested for this misdemeanor, which was not committed in the presence of the deputy, either before, during, or immediately after his confession. He was not arrested on the criminal mischief charge until the affidavit and petition were filed and was, therefore, not placed into custody for purposes of the statute at the time he was interviewed. S.V. v. State, 560 So.2d 402 (Fla. 4th DCA 1990). The petition was, accordingly, filed within the forty-five day period required by the statute, and the trial court erred by dismissing it. We, accordingly, reverse and remand for further proceedings consistent herewith.
Reversed and remanded.
FRANK, C.J., and DANAHY and SCHOONOVER, JJ., concur.