
738 So.2d 446 (1999)
Merrick MAGNUS, Appellant,
v.
STATE of Florida, Appellee.
No. 98-1602.
District Court of Appeal of Florida, Fourth District.
July 21, 1999.
Merrick Magnus, Miami, pro se.
Robert A. Butterworth, Attorney General, Tallahassee, and Leslie T. Campbell, *447 Assistant Attorney General, West Palm Beach, for appellee.
KLEIN, J.
Appellant, who was incarcerated in Dade county, filed a petition for writ of habeas corpus in Broward county, alleging that he is being improperly incarcerated because of errors regarding gain time. The state responded that a prisoner can only seek habeas corpus in the circuit court where the prisoner is detained, and that appellant should first have sought relief through the Department of Corrections.
Section 79.09, Florida Statutes (1993) provides that a petition for writ of habeas corpus "shall be filed with the clerk of the circuit court of the county in which the prisoner is detained." This statute is consistent with the common law, under which courts do not have the authority to issue writs to be executed beyond their territorial jurisdiction. Newman v. Hornsby, 385 So.2d 1106 (Fla. 5th DCA 1980); Campbell v. Florida Parole Comm'n, 630 So.2d 1210 (Fla. 1st DCA 1994). See also Yates v. Buchanan, 170 So.2d 72 (Fla. 3d DCA 1964) and cases cited. As it happens, this court could not grant relief to petitioner either, because he is outside its territorial jurisdiction. Alachua Reg'l Juvenile Detention Ctr. v. T.O., 684 So.2d 814, 816 (Fla.1996)(construing, Art. V, § 4(c), Fla. Const.)
In the present case the trial court denied the petition without explaining why. When it is apparent to a trial court that a petition for habeas corpus has been filed in the wrong court, it could save an unnecessary appeal which could substantially delay the release of a wrongfully incarcerated person, if the trial court would transfer the petition to the proper court. In the present case the state, in its response, pointed out that the petition had been filed in the wrong court and also that the appellant should first have sought administrative relief before the Department of Corrections. We affirm without prejudice to appellant seeking administrative relief if appropriate, or habeas relief in the circuit court of the county in which he is incarcerated.
STONE and TAYLOR, JJ., concur.
