In 1985, the defendant was adjudicated guilty of committing a sexual batteiy on a child less than twelve years of age.1 In the subsequent eleven years, the defendant has sought review of his judgment and sentence by way of a direct appeal, two motions for post-conviction relief, an appeal of the denial of the second motion for post-conviction relief, two federal habeas carpus petitions, and two state habeas corpus petitions. All post-conviction proceedings were resolved unfavorably to the defendant. Currently before this court for review is the trial court’s denial on the merits of the defendant’s third petition for writ of habeas corpus.
The defendant is incarcerated in DeSoto County. He filed his petition in Putnam County. Section 79.09, Florida Statutes (1995), requires that a petition for habeas corpus be filed with the clerk of the court in the county where the defendant is detained. See also Raley v. State, 675 So.2d 170 (Fla. 5th DCA), cause dismissed, 678 So.2d 1287 (Fla.) and appeal dismissed, — So.2d — (Fla.1996). Accord Newman v. Hornsby, 385 So.2d 1106 (Fla. 5th DCA 1980). Therefore, the trial court lacked the authority to rule upon the defendant’s petition for writ of habeas corpus because the defendant is detained outside the court’s territorial jurisdiction. The petition should have been dismissed. Accordingly, we are constrained to vacate the trial court’s order denying the petition. Savage v. State, 662 So.2d 750 (Fla. 4th DCA 1995).
VACATED.
PETERSON, C.J., and THOMPSON, J., concur.. § 794.011(2), Fla. Stat. (1985).