
394 So.2d 215 (1981)
Earnest James FINLEY, Appellant,
v.
STATE of Florida, Appellee.
No. XX-369.
District Court of Appeal of Florida, First District.
February 23, 1981.
Earnest James Finley, in pro. per.
Jim Smith, Atty. Gen., and Wallace E. Allbritton, Asst. Atty. Gen., for appellee.
SHIVERS, Judge.
This is an appeal from an order of the Circuit Court denying appellant's petition for writ of habeas corpus on the grounds that the petition was legally insufficient on its face. We affirm.
Appellant filed a petition for writ of habeas corpus in the Circuit Court which had *216 imposed his judgment and sentence, alleging that the double jeopardy clause precluded him from being convicted and sentenced for robbery with a deadly weapon because robbery was the underlying felony upon which his 1978 first degree murder conviction was based. See, Harris v. Oklahoma, 433 U.S. 682, 97 S.Ct. 2912, 53 L.Ed.2d 1054 (1977); Pinder v. State, 375 So.2d 836 (Fla. 1979). Therefore, he sought to have his conviction and sentence for robbery vacated. The Circuit Court denied the petition on the grounds that it was legally insufficient on its face.
The Circuit Court properly denied the petition for habeas corpus for two reasons. First, the Circuit Court was without authority to issue the writ of habeas corpus. State ex rel. Wainwright v. Holley, 234 So.2d 409 (Fla. 2d DCA 1970); Ruiter v. Wainwright, 249 So.2d 67 (Fla. 2d DCA 1971). Section 79.09, Fla. Stat. (1979), requires that a petition for habeas corpus before a circuit court must be filed with the circuit court of the county in which the prisoner is detained. Since appellant was detained in Highlands County at the time of the filing of the petition below, the petition should have been filed in the Circuit Court for Highlands County rather than the Circuit Court for Okaloosa County.
Additionally, the remedy of habeas corpus is not available as a substitute for post-conviction relief under Rule 3.850, Fla. R.Crim.P. An application for writ of habeas corpus shall not be entertained where the applicant has failed to first apply for post-conviction relief, provided a motion for post-conviction relief is adequate to test the legality of the detention. Zungia v. State, 184 So.2d 659 (Fla. 1st DCA 1966), cert. denied, 189 So.2d 635 (Fla. 1966), cert. denied, 385 U.S. 962, 87 S.Ct. 404, 17 L.Ed.2d 307 (1966); Fla.R.Crim.P. 3.850. Therefore, since the issue raised in appellant's petition for habeas corpus may be raised by a motion for post-conviction relief, his failure to exhaust this remedy precludes habeas relief.
Accordingly, the appealed order is AFFIRMED.
SHAW and THOMPSON, JJ., concur.
