
918 So.2d 999 (2006)
Roosevelt RICHARDSON, Appellant,
v.
STATE of Florida, Appellee.
No. 5D05-1868.
District Court of Appeal of Florida, Fifth District.
January 20, 2006.
*1000 Roosevelt Richardson, Polk City, pro se.
Charles J. Crist, Jr., Attorney General, Tallahassee, and Lamya A. Henry, Assistant Attorney General, Daytona Beach, for Appellee.
SAWAYA, J.
We dispel the notion, apparently held by some, that when a petition for writ of habeas corpus is filed challenging the underlying conviction, the petition must in all instances be treated as a motion for post-conviction relief under Florida Rule of Criminal Procedure 3.850 and either granted or denied on the merits. We believe, based on clear precedent from the Florida Supreme Court and the District Courts of Appeal, that it is proper to dismiss a habeas petition collaterally attacking the conviction when it is clearly discernable that the claims raised are procedurally barred or do not comply with the requirements of rule 3.850. Here dismissal was appropriate as we will now explain.
Roosevelt Richardson, pro se, was convicted of felony offenses arising out of crimes committed in Volusia County, which is situated within the Seventh Judicial Circuit. Having unsuccessfully appealed those convictions to this court, he filed a petition for writ of habeas corpus in the Circuit Court of Volusia County, contending that he had been mentally incompetent to stand trial. Because he was illegally convicted, he contends, his release from the confines of the Polk Correctional Institution in Polk County, which is in the Tenth Judicial Circuit, is the appropriate remedy for the injustice inflicted upon him.
The trial court summarily denied the petition because, the court found, it lacked jurisdiction and because the issues Richardson attempted to raise were issues which were or could have been raised on direct appeal. Richardson contends this was error and that he is entitled to the relief requested in his petition, which is nothing more than a rule 3.850 motion for postconviction relief disguised as a petition for a writ of habeas corpus. Richardson suggests that his petition should be treated as a rule 3.850 motion, arguing that he is entitled "to collaterally attack the conviction by proving his incompetency" and that he "is entitled to an evidentiary hearing for that purpose." We will first address the jurisdictional issue and explain why the petition was filed in the proper locale. Then we will explain why we have come to the conclusion that the petition should have been dismissed and why it should not be treated as a rule 3.850 motion.
*1001 We agree with the State's pronouncement of the general rule that a petition for writ of habeas corpus should be filed in the circuit where the defendant is detained  in this case, the Tenth Judicial Circuit.[1] But there is an exception explained previously by us in Collins v. State, 859 So.2d 1244, 1245-46 (Fla. 5th DCA 2003), wherein we stated that "[w]hen a petitioner attacks the validity of the conviction by raising issues relating to the trial or to the propriety of a plea, jurisdiction in habeas proceedings lies with the trial court that imposed the sentence and rendered the judgment of conviction." Id. at 1245 (citing Sheriff v. Moore, 781 So.2d 1146 (Fla. 1st DCA 2001); Frederick v. State, 714 So.2d 1043, 1043 (Fla. 4th DCA) ("Habeas petitions directed to trial issues must be brought in the circuit court for the county where the trial occurred."), review denied, 728 So.2d 201 (Fla.1998); McLeroy v. State, 704 So.2d 151 (Fla. 5th DCA 1997) (dismissing petition for habeas corpus alleging ineffective assistance of trial counsel because the petition must be filed in court where original sentence imposed, not where defendant is incarcerated); Leichtman v. Singletary, 674 So.2d 889 (Fla. 4th DCA 1996)); see also Barnes v. Crosby, 909 So.2d 534, 535 (Fla. 2d DCA 2005) ("Because Barnes was attacking the validity of the proceedings in the Tenth Judicial Circuit Court, jurisdiction to entertain the petition lay with that court.").
The essence of Richardson's claim is that he was mentally incompetent to stand trial, and this is clearly a trial issue appropriately addressed by the circuit court that adjudicated Richardson guilty of the crimes he committed. Hence, the trial court in Volusia County did have jurisdiction. We note, parenthetically, that had jurisdiction been found lacking, the appropriate disposition would have been dismissal of the petition rather than denial on the merits. Nevertheless, as we will next explain, dismissal of the petition is the appropriate disposition here because the issue of mental incompetence should have been raised in Richardson's prior appeal rather than in his petition for habeas corpus.
The precedent previously alluded to, upon which we rely to arrive at our conclusion that Richardson's petition should have been dismissed, derives from analysis of the historical development of rule 3.850 and the writ of habeas corpus, which is constitutionally guaranteed to all citizens of Florida by Article I, Section 13 of the Florida Constitution. We need not indulge repetition of that analysis here. Suffice it to say that historically, habeas corpus proceedings were the means available to a defendant to challenge the validity *1002 of his or her conviction and sentence. See State ex rel. Butterworth v. Kenny, 714 So.2d 404, 408-09 (Fla.1998). Heavily borrowing from the provisions of 28 U.S.C.A. 2255, the Florida Supreme Court in 1963 enacted Florida Rule of Criminal Procedure 1, which was the predecessor to current rules 3.850 and 3.851, Florida Rules of Criminal Procedure. As was its federal counterpart, rule 1 was "promulgated to establish an effective procedure in the courts best equipped to adjudicate the rights of those originally tried in those courts .... [and] provide a complete and efficacious post-conviction remedy to correct convictions on any grounds which subject them to collateral attack." Roy v. Wainwright, 151 So.2d 825, 828 (Fla.1963). As the court explained in Baker v. State, 878 So.2d 1236 (Fla.2004), "The history of rule 3.850 ... indicates that it was intended to provide a procedural mechanism for raising those collateral postconviction challenges to the legality of criminal judgments that were traditionally cognizable in petitions for writs of habeas corpus .... [and] essentially transfer[] consideration of these traditional habeas claims from the court having territorial jurisdiction over the prison where the prisoner is detained to the jurisdiction of the sentencing court." Id. at 1238-39 (footnote omitted); see also Collins, 859 So.2d at 1246 ("Claims that a plea was involuntary or that trial counsel rendered ineffective assistance are issues that may now more appropriately be raised in a motion under Florida Rule of Criminal Procedure 3.850. Prior to adoption of this rule, habeas corpus was the primary procedural device to challenge the validity of a sentence or judgment of conviction. Adoption of the rule superseded habeas corpus as the method to collaterally attack a sentence or judgment of conviction.").
Since adoption of rule 3.850 and its predecessor, the courts have consistently held that it is inappropriate to collaterally attack a conviction through the process of habeas proceedings because such claims are cognizable under the rule. Baker; Washington v. State, 876 So.2d 1233, 1234 (Fla. 5th DCA 2004) ("A petition for habeas corpus may not be used to collaterally attack a criminal judgment and sentence because Florida Rule of Criminal Procedure 3.850 has superseded habeas corpus as the only means to raise such issues."); Collins; Spratling v. State, 851 So.2d 228 (Fla. 1st DCA 2003); Bryant v. State, 780 So.2d 978, 979 (Fla. 5th DCA) ("We agree with the trial court that Bryant is collaterally attacking his judgment and sentence and that the proper method to do so was to file a motion pursuant to Florida Rules of Criminal Procedure 3.850."), review denied, 791 So.2d 1095 (Fla.2001). Indeed, rule 3.850(h) specifically provides that a petition for writ of habeas corpus "shall not be entertained" when the issues raised by the defendant may be considered in a motion filed under the rule.[2] The courts *1003 have also consistently held that habeas proceedings may not be utilized to present issues that should have been raised on appeal or to obtain a second appeal. Baker; Wright v. State, 857 So.2d 861, 874 (Fla.2003) ("Habeas corpus should not be used as a vehicle for presenting issues which should have been raised at trial and on appeal or in postconviction proceedings."), cert. denied, 541 U.S. 961, 124 S.Ct. 1715, 158 L.Ed.2d 402 (2004); Guilford v. State, 908 So.2d 588 (Fla. 5th DCA 2005); Collins.
In Baker, the Florida Supreme Court specifically addressed those instances where dismissal of a petition for writ of habeas corpus is appropriate:
Accordingly, from now on, we will dismiss as unauthorized, habeas corpus petitions filed by noncapital defendants that seek the kind of collateral postconviction relief available through a motion filed in the sentencing court, and which (1) would be untimely if considered as a motion for postconviction relief under rule 3.850, (2) raise claims that could have been raised at trial or, if properly preserved, on direct appeal of the judgment and sentence, or (3) would be considered a second or successive motion under rule 3.850 that either fails to allege new or different grounds for relief, or alleges new or different grounds for relief that were known or should have been known at the time the first motion was filed.
878 So.2d at 1245-46 (emphasis added); see also Brown v. Crosby, 908 So.2d 512, 512 (Fla. 1st DCA 2005) (dismissing habeas corpus petition as unauthorized where petition sought to collaterally attack sentence; noting Baker's reiteration of "the well-established rule that habeas corpus will not lie as a substitute for a motion for postconviction relief under the Rules of Criminal Procedure").
Clearly, habeas corpus petitions that seek to obtain collateral relief regarding claims that could or should have been raised on direct appeal of the judgment and sentence, as we have in this case,[3] should not be treated as Florida Rule of *1004 Criminal Procedure 3.850 motions, but rather should be dismissed. This court has previously recognized the propriety of this disposition by the trial court. In Guilford, the defendant filed a petition for writ of habeas corpus in the trial court seeking to collaterally attack his conviction and sentence. We noted that the proceedings before this court were "[i]n substance... an appeal of the trial court's order which dismissed his petition for writ of habeas corpus or an appeal of an order summarily dismissing a Rule 3.850 motion." 908 So.2d at 589. We dismissed the proceeding in this court and held:
The trial court properly dismissed the petition, pointing out that habeas corpus is not a second appeal mechanism, and may not be used to litigate issues that could or should have been raised on direct appeal. See, e.g., Breedlove v. Singletary, 595 So.2d 8 (Fla.1992). Further, it noted that habeas corpus relief is not available with respect to claims that could be raised in a Rule 3.850 motion. See Baker v. State, 878 So.2d 1236 (Fla. 2004). All of the issues raised in Guilford's petition below could or should have been raised in a direct appeal or by a motion filed pursuant to Rule 3.850, and the applicable time limits to raise them have long since passed.
Id. at 590.
Hence, in the three instances enumerated in Baker, dismissal rather than treatment of the petition as a rule 3.850 motion is the appropriate remedy. See also Barnes, 909 So.2d at 535 ("A petition for writ of habeas corpus cannot be used as a substitute for an appropriate postconviction motion. Barnes has not demonstrated that such a motion would have been inadequate or ineffective to address his claim, and his petition was not filed within the time period allowed for filing a rule 3.850 motion. Thus, we cannot fault the circuit court for not treating the petition as a rule 3.850 motion. Accordingly, we affirm the trial court's dismissal of the petition, although on a different ground than the one relied on by the trial court.") (citing Fla. R.Crim. P. 3.850(h); Baker; Pinder v. State, 779 So.2d 309, 309-10 (Fla. 2d DCA 1999)).
Although Richardson's petition should have been summarily dismissed by the trial court, prudence dictates that, for purposes of judicial economy, we should affirm the order denying the petition rather than vacate it and remand to the trial court for entry of an order of dismissal. However, we emphasize that when a habeas petition is filed raising inappropriate issues that fall within one of the three categories enumerated in Baker, the appropriate disposition is dismissal. Treating the petition as a rule 3.850 motion and deciding the issues on the merits based on attendant hearings before the trial court is indeed a waste of valuable judicial resources.
AFFIRMED.
GRIFFIN and TORPY, JJ., concur.
NOTES
[1]  See § 79.09, Fla. Stat. (2004) ("Before a circuit judge the petition and the papers shall be filed with the clerk of the circuit court of the county in which the prisoner is detained. Before the other courts, justices or judges, the papers shall be filed with the clerk of the court on which the justice or judge sits."); Torres v. State, 700 So.2d 1247, 1247 (Fla. 5th DCA 1997) ("The proper procedure is for Torres to petition the circuit court in the Second Judicial Circuit for a writ of habeas corpus, since he is incarcerated in the Quincy Correctional Institution. Only the circuit court within the county where he is incarcerated has jurisdiction.") (citations omitted); Gaffney v. State, 681 So.2d 1211, 1211 (Fla. 5th DCA 1996) ("[T]he 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."); Campbell v. Florida Parole Comm'n, 630 So.2d 1210, 1211 (Fla. 1st DCA 1994) ("Because the authority of the court to issue a writ is limited to its territorial jurisdiction, the court lacks jurisdiction where the writ would have to be executed beyond the court's territorial jurisdiction.") (citations omitted), vacated on other grounds by 514 U.S. 1094, 115 S.Ct. 1819, 131 L.Ed.2d 742 (1995), reinstated on remand by 657 So.2d 67 (Fla. 1st DCA 1995).
[2]  The court in Baker v. State, 878 So.2d 1236, 1241 (Fla.2004), considered the full text of rule 3.850(h), which provides:

An application for writ of habeas corpus on behalf of a prisoner who is authorized to apply for relief by motion pursuant to this rule shall not be entertained if it appears that the applicant has failed to apply for relief, by motion, to the court that sentenced the applicant or that the court has denied the applicant relief, unless it also appears that the remedy by motion is inadequate or ineffective to test the legality of the applicant's detention.
Fla. R.Crim. P. 3.850(h) (emphasis added). Directing its attention to the emphasized clause, the court explained that:
The last clause of rule 3.850(h) might suggest that it is permissible to file a petition for writ of habeas corpus to test the legality of a prisoner's criminal judgment rather than to seek relief through an appropriate postconviction motion. However, the courts of this state have correctly interpreted this provision to mean that "habeas corpus may not be used as a substitute for an appropriate motion seeking postconviction relief pursuant to the [rule]." Harris v. State, 789 So.2d 1114, 1115 (Fla. 1st DCA 2001); see also Leichtman v. Singletary, 674 So.2d 889, 891 (Fla. 4th DCA 1996) ("The remedy of habeas corpus is not available as a substitute for post-conviction relief under rule 3.850, Florida Rules of Criminal Procedure."). Nor can habeas corpus be used as a means to seek a second appeal or to litigate issues that could have been or were raised in a motion under rule 3.850. See Breedlove v. Singletary, 595 So.2d 8, 10 (Fla.1992) ("Habeas corpus is not a second appeal and cannot be used to litigate or relitigate issues which could have been ... or were raised on direct appeal."); Mills v. Dugger, 574 So.2d 63, 65 (Fla.1990) ("[H]abeas corpus is not to be used `for obtaining additional appeals of issues which were raised, or should have been raised, on direct appeal or which were waived at trial or which could have ... or have been, raised in prior postconviction filings."); see also Patterson v. State, 664 So.2d 31, 32 (Fla. 4th DCA 1995) (affirming circuit court's denial of petition for writ of habeas corpus "[b]ecause it [was] apparent that [the] Defendant [was] seeking an untimely motion for post conviction relief pursuant to Florida Rule of Criminal Procedure 3.850").
878 So.2d at 1241.
[3]  The issue of mental incompetence to stand trial is an issue that should have been raised in Richardson's prior appeal to this court. See Carroll v. State, 815 So.2d 601, 610 (Fla. 2002) ("Carroll's underlying claim that he was incompetent to stand trial should have been raised on direct appeal and therefore is procedurally barred.") (citing Patton v. State, 784 So.2d 380, 393 (Fla.2000); Johnston v. Dugger, 583 So.2d 657, 659 (Fla.1991)); Cherry v. State, 781 So.2d 1040 (Fla.2000), cert. denied, 534 U.S. 878, 122 S.Ct. 179, 151 L.Ed.2d 124 (2001).
