
62 So.3d 1122 (2011)
Mark HENRY, Warden, etc., Petitioner,
v.
Runner O. SANTANA, Respondent.
No. SC09-1027.
Supreme Court of Florida.
April 28, 2011.
*1123 Jennifer Alani Parker, General Counsel, Department of Corrections, Beverly Bartlett Brewster and Carolyn J. Mosely, Assistant General Counsels, Tallahassee, FL, for Petitioner.
Henry G. Gyden of Swope, Rodante, P.A., Tampa, FL, for Respondent.
PERRY, J.
This case is before the Court for review of the decision of the First District Court of Appeal in Santana v. Henry, 12 So.3d 843 (Fla. 1st DCA 2009). The district court certified that its decision is in direct conflict with the decision of the Third District Court of Appeal in Pope v. State, 898 So.2d 253 (Fla. 3d DCA 2005). We have jurisdiction. See art. V, § 3(b)(4), Fla. Const.
The issue presented is whether a court may sua sponte dismiss a petition for a writ of habeas corpus, in which a prisoner is seeking immediate release, based upon the petitioner's failure to allege exhaustion of administrative remedies. As further explained below, we hold that such a petition may not be dismissed on such grounds where the issue of the petitioner's failure to exhaust administrative remedies has not been raised by the parties.

FACTS AND PROCEDURAL BACKGROUND
On June 24, 2008, Santana, an inmate, filed a pro se petition for writ of habeas corpus in the circuit court in Jackson County, alleging that he was entitled to immediate release. He filed the petition against Mark Henry, warden of the facility in Jackson County where he was housed. Santana's claim concerned the sentences that were imposed on October 4, 2007, following his violation of probation (VOP). The relevant facts are set forth in the district court opinion below:
Runner O. Santana appeals the dismissal of his petition for writ of habeas corpus alleging "that he is entitled to immediate release when properly credited with time served" and requesting "issuance of an Order com[m]anding the Florida Department of Corrections ... to immediately release" him. Without prior notice to the parties or input from them, the trial court summarily dismissed the petition. It reasoned, in part, that Mr. Santana failed to exhaust administrative remedies, although the Department of Corrections (DOC) never raised this below....
The petition below alleges that, after his probation (in three separate cases) was revoked, Mr. Santana was sentenced anew on October 4, 2007, receiving three concurrent prison sentences. In case No. 95-CF-4926, the petition alleges, he was sentenced to six years in prison with credit for 2,023 days, to be followed by two years' probation; in case No. 96-CF-9601 to 60.75 months with credit for 831 days; and in case No. 96-CF-10668 to six years with credit for 1682 days. In addition, against each sentence, the petition alleges, he was awarded "credit for time served at the State Hospital," and a separate credit for 142 days for time spent in jail before the revocation hearing....
Attached to the petition are the sentencing documents, as well as a transcript of the sentencing hearing.
*1124 Santana v. Henry, 12 So.3d 843, 844-45 (Fla. 1st DCA 2009) (footnotes omitted).
The district court framed the issue before it narrowly, as follows:
At issue is whether the habeas court properly dismissed the petition on its own motion without hearing from the authorities alleged to hold the petitioner unlawfully. We are not concerned here with mere conditions of confinement, or gain-time calculations not affecting DOC's current right to hold the petitioner, or anything less than a state prisoner's alleged right to immediate release from custody.
Id. at 845-46 (citations omitted). The district court then addressed the traditional role of the writ of habeas corpus versus the role of the doctrine of exhaustion of administrative remedies and held that the trial court erred in dismissing Santana's habeas petition on the basis of a technicality not raised by the partiesi.e., Santana's failure to allege that he had exhausted his administrative remedies:
In any event, we hold the trial court erred by dismissing Mr. Santana's petition for writ of habeas corpus on the basis of a technicalityan assumed pleading defectthat was not raised by the parties. It is not clear DOC would have defended in this fashion, left to its own devices. "A trial judge may not sua sponte dismiss an action based on affirmative defenses not raised by proper pleadings." Liton Lighting v. Platinum Television Group, Inc., 2 So.3d 366, 367 (Fla. 4th DCA 2008).
Santana, 12 So.3d at 847-48 (citations omitted). The district court ruled as follows:
Mindful that the "writ of habeas corpus is the fundamental instrument for safeguarding individual freedom against arbitrary and lawless state action," Harris v. Nelson, 394 U.S. 286, 290-91, 89 S.Ct. 1082, 22 L.Ed.2d 281 (1969), we reverse and remand with directions that the trial court issue an order to show cause to the Department of Corrections before proceeding further.
Santana, 12 So.3d at 844-45 (citations omitted). The district court certified conflict with Pope v. State, 898 So.2d 253 (Fla. 3d DCA 2005).[1] DOC sought review in this Court, which was granted.

ANALYSIS
The writ of habeas corpus, or the Great Writ, is a high prerogative writ and, when properly issued, supersedes all other writs. State ex rel. Perky v. Browne, 105 Fla. 631, 142 So. 247, 248 (1932). The writ, which literally means "that you have the body," is a writ of inquiry and has traditionally been used to compel the custodian *1125 of the prisoner to bring the body of the prisoner into court so that the legality of the detention might be tested. This Court in State ex rel. Deeb v. Fabisinski, 111 Fla. 454, 152 So. 207 (1933), addressed the deep roots of the writ in Anglo-American jurisprudence:
The great writ, known commonly by the name of "habeas corpus," was a high prerogative writ known to the common law, the object of which was the liberation of those who were imprisoned without sufficient cause. See Ex parte Watkins, 3 Pet. (U.S.) 193, 7 L.Ed. 650 [(1830) ].
It is a writ of inquiry upon matters of which the state itself is concerned in aid of right and liberty. State ex rel. Lasserre v. Michel, 105 La. 741, text 747, 30 So. 122, 54 L.R.A. 927; Ex parte Coupland, 26 Tex. 386.
The name of the writ is "habeas corpus ad subjiciendum et recipiendum." It is not an action or suit, but is a summary remedy open to the person detained. It is civil rather than criminal in nature and is a legal and not equitable remedy. See Ex parte Watkins, supra; Ex parte Bollman, 4 Cranch (U.S.) 75, 2 L.Ed. 554 [ (1807) ].
... [W]hile the writ had been in use in England from remote antiquity, it was often assailed by kings who sought tyrannical power and the benefits of the writ were in a great degree eluded by time-serving judges who assumed a discretionary power in awarding or refusing it and were disposed to support royal and ministerial usurpations. Owing to such abuses, the writ became powerless to release persons imprisoned without any cause assigned. In the fight by the people against the abuses of the writ, petitions of rights were submitted to the king, and during the reign of Charles I, A.D. 1641, provisions were enacted intended to make the writ effectual. These activities were, however, in vain. At last, in 1679, the Statute 31 Chas. II, chap. 2, was enacted. That act is known as the [H]abeas [C]orpus [A]ct. That act has been substantially incorporated into the jurisprudence of every state in the Union and the right to it secured by their Constitutions. The Constitution of the United States provides that the privilege of the writ of habeas corpus shall not be suspended except in certain circumstances. Article 1, § 9, par. 2, U.S. Const.
....
The great writ of habeas corpus is the one mentioned in Magna Charta in the year 1215; the writ which alone was the subject of the acts of 16 Chas. I and 31 Chas. II. It was the writ referred to in the Declaration of Independence and secured to the people of this country by the Constitution of the United States and the Constitutions of the different states.
Fabisinski, 152 So. at 209-10.[2] This Court subsequently in Allison v. Baker, 152 Fla. 274, 11 So.2d 578 (1943), reiterated the basic purpose of the writ:
The writ of habeas corpus is a high prerogative writ of ancient origin designed to obtain immediate relief from unlawful imprisonment without sufficient legal reasons. Essentially, it is a writ of inquiry and is issued to test the reasons or grounds of restraint and detention. The writ is venerated by all free and liberty loving people and recognized as a *1126 fundamental guaranty and protection of their right of liberty.
Id. at 579.[3]
Given the basic purpose and fundamental importance of the writ, this Court has long recognized the necessity of informality and tolerance with regard to the pleading requirements for the writ:
The writ of habeas corpus is a writ of right. It is sometimes issued upon very informal application. Ex parte Pells, 28 Fla. 67, 9 So. 833 [ (1891) ]. Neither the right to the writ nor the right to be discharged from custody in a proper case is made to depend upon meticulous observance of the rules of pleading. The purpose of bringing the petitioner before the court is to inquire into the legality of his detention, and if during the proceedings it appears formally or informally to the court's satisfaction that the person is unlawfully deprived of his liberty and is illegally detained in custody against his will he will be discharged.
Ex parte Amos, 93 Fla. 5, 112 So. 289, 291-92 (1927). This Court has emphasized this need for informality repeatedly:
[H]istorically, habeas corpus is a high prerogative writ. It is as old as the common law itself and is an integral part of our own democratic process. The procedure for the granting of this particular writ is not to be circumscribed by hard and fast rules or technicalities which often accompany our consideration of other processes. If it appears to a court of competent jurisdiction that a man is being illegally restrained of his liberty, it is the responsibility of the court to brush aside formal technicalities and issue such appropriate orders as will do justice. In habeas corpus the niceties of the procedure are not anywhere near as important as the determination of the ultimate question as to the legality of the restraint.
Anglin v. Mayo, 88 So.2d 918, 919-20 (Fla. 1956). This Court has gone so far as to rule that "[n]o formal application for habeas corpus is required." Martin v. State, 123 Fla. 143, 166 So. 467, 467 (1936).
The gravamen of the issue before the Court is whether the writ of habeas corpus should be encumbered by a pleading requirement regarding the exhaustion of administrative remedies in those cases where an inmate is seeking immediate release. DOC contends that unless the inmate first exhausts administrative remedies, he or she will be unable to file an informed petition because the petition will be based on mere speculation concerning the inmate's term of imprisonment and release date. DOC also contends that if the inmate fails to exhaust administrative remedies, the courts too will be operating in the dark in the same respect. DOC contends that the district court's ruling below will encourage inmates to file free habeas petitions instead of utilizing the Department's internal grievance procedure. In brief, it appears that DOC, for its own purposes, would prefer to respond to such inmate inquiries via its own internal grievance procedure rather than respond to orders to show cause issued by the courts. In *1127 light of the above authorities, however, it appears that DOC's proposed pleading requirement is antithetical to the basic purpose and fundamental importance of the writ.
In the decision under review, the district court addressed at length the traditional role of the writ of habeas corpus in relation to the doctrine of exhaustion of remedies:
"The writ of habeas corpus is a high prerogative writ of ancient origin designed to obtain immediate relief from unlawful imprisonment without sufficient legal reasons. Essentially, it is a writ of inquiry and is issued to test the reasons or grounds of restraint and detention. The writ is venerated by all free and liberty loving people and recognized as a fundamental guaranty and protection of their right of liberty." Allison v. Baker, 152 Fla. 274, 11 So.2d 578, 579 (1943). "The great writ has its origins in antiquity and its parameters have been shaped by suffering and deprivation. It is more than a privilege with which free men are endowed by constitutional mandate; it is a writ of ancient right." Jamason v. State, 447 So.2d 892, 894 (Fla. 4th DCA 1983). "[H]istorically, habeas corpus is a high prerogative writ. It is as old as the common law itself and is an integral part of our own democratic process." Anglin v. Mayo, 88 So.2d 918, 919 (Fla.1956).
By comparison, judicial abstention in favor of exhaustion of administrative remedies is a relatively recent invention. The doctrine of exhaustion of remedies counsels against judicial intervention in the decision-making function of the executive branch in certain circumstances. Whether to require exhaustion of administrative remedies is a question of judicial "policy rather than power." Gulf Pines Mem'l Park, Inc. v. Oaklawn Mem'l Park, Inc., 361 So.2d 695, 699 (Fla.1978). See also State, Dep't of Revenue v. Brock, 576 So.2d 848, 850 (Fla. 1st DCA 1991) ("[T]he doctrine requiring the exhaustion of administrative remedies is not jurisdictional. The exhaustion requirement is a court-created prudential doctrine; it is a matter of policy, not of power." (citations omitted)).
Notions of administrative autonomy have been thought to require that agencies be given the opportunity to discover and correct their own errors, even after a case has reached the courts for judicial review of agency action. In some contexts, judicial restraint may be necessary "to support the integrity of the administrative process and to allow the executive branch to carry out its responsibilities as a co-equal branch of government." [Key Haven Associated Enters., Inc. v. Bd. of Trs. of the Internal Improvement Trust Fund, 427 So.2d 153, 157 (Fla. 1982) ]. When an agency has discretion to exercise, it should of course be allowed to make discretionary decisions. If a party succeeds in vindicating its rights in the administrative process, thus obviating the need for judicial intervention, judicial resources are conserved; and immediate judicial access can weaken the effectiveness of an agency by encouraging people to ignore its procedures.
But the rationales for requiring exhaustion of administrative remedies diminish and disappear where an executive branch agency has little or no discretion to exercise and little or no expertise to bring to bear. The Department of Corrections does have discretion in deciding, for example, the conditions of confinement, and does have its own procedures on this subject deserving of judicial deference. On the other hand, the DOC has no *1128 discretion about which prisoners to release upon expiration of their sentences. Sentencing is a power, obligation, and prerogative of the courts, not the DOC.
....
... While the general rule is that exhaustion of administrative remedies is an affirmative defense, see Sylvia H. Walbolt, Matthew J. Conigliaro & J. Andrew Meyer, Florida Civil Practice Before Trial, § 25.34 at 25-30 (7th ed. 2004) ("Affirmative defenses to extraordinary writs include impossibility or lack of power to perform, laches, unclean hands, absence of parties whose substantial rights would be affected, illegality of purpose, detriment to the public interest, mootness, and failure to exhaust administrative remedies. See FLORIDA APPELLATE PRACTICE § 20.38 (Fla. Bar CLE 5th ed. 2003)"), moreover, in the prisoner habeas context, it has been held that certain petitions must allege exhaustion of administrative remedies in order to be facially sufficient. But none of the cases to which our attention has been drawn has laid down such a pleading requirement for petitions for writ of habeas corpus alleging entitlement to immediate release. The petitioners in [the other cases] sought relief from conditions of confinement or restoration of forfeited gain time, not immediate release from the DOC's custody.
Santana, 12 So.3d at 846-47 (citations omitted).
The district court held that the trial court erred in dismissing Santana's habeas petition based on a technicality not raised by the parties, and the court then noted the following:
The general rule that pleadings ought not be dismissed on grounds no party urges has special force when the pleading is a petition for writ of habeas corpus. "The scope and flexibility of the writits capacity to reach all manner of illegal detentionits ability to cut through barriers of form and procedural mazeshave always been emphasized and jealously guarded by courts and lawmakers. The very nature of the writ demands that it be administered with the initiative and flexibility essential to insure that miscarriages of justice within its reach are surfaced and corrected." Harris v. Nelson, 394 U.S. 286, 291, 89 S.Ct. 1082, 22 L.Ed.2d 281 (1969). When a petition for writ of habeas corpus alleging that the petitioner is entitled to immediate release sets out plausible reasons and a specific factual basis in some detail, the custodian should be required to respond to the petition.
Santana, 12 So.3d at 848 (citations omitted).
The district court added as a postscript the following passage explaining its ruling further:
If in this case the petition had not been summarily denied and the trial court had instead ordered the DOC to show cause why Mr. Santana's petition should not be granted, the DOC might have resisted by moving to dismiss on exhaustion of administrative remedies grounds or for failure to allege exhaustion but it might also have decided that the petition was meritorious and released the petitioner. "The procedure for the granting of this particular writ [i.e., habeas corpus] is not to be circumscribed by hard and fast rules or technicalities which often accompany our consideration of other processes. If it appears to a court of competent jurisdiction that a man is being illegally restrained of his liberty, it is the responsibility of the court to brush aside formal technicalities and issue such appropriate *1129 orders as will do justice. In habeas corpus the niceties of the procedure are not anywhere near as important as the determination of the ultimate question as to the legality of the restraint." Anglin, 88 So.2d at 919-20.
Santana, 12 So.3d at 848 (brackets in original).
In light of the constitutional and statutory authorities and precedent from this Court noted above, we conclude that the district court below ruled correctly, and we hold that a petition for a writ of habeas corpus, in which a prisoner is seeking immediate release, may not be dismissed based upon the petitioner's failure to allege exhaustion of administrative remedies where such failure has not been raised by the parties.

CONCLUSION
Based on the above, we approve the First District Court of Appeal's decision below and disapprove the Third District Court of Appeal's decision in Pope v. State, 898 So.2d 253 (Fla. 3d DCA 2005), to the extent it is inconsistent with this opinion.
It is so ordered.
PARIENTE, LEWIS, QUINCE, and LABARGA, JJ., concur.
CANADY, C.J., and POLSTON, J., concur in result.
NOTES
[1]  In Pope v. State, 898 So.2d 253 (Fla. 3d DCA 2005), the Third District Court of Appeal held as follows:

Anthony Evans Pope appeals the denial of his Emergency Petition for Writ of Habeas Corpus Ad Testificandum. The petition alleges that the appellant is being illegally detained by the Department of Corrections beyond his maximum release date.
When Appellant filed his petition with the trial court, he failed to allege, or prove, that he had exhausted any of the administrative procedures available to him prior to filing the petition. The prerequisite to the issuance of an extraordinary writ is exhaustion of all administrative remedies. The trial court, without addressing the merits, summarily and correctly denied the appellant's petition, without prejudice, finding the petition facially insufficient for failing to allege the appellant had exhausted all of the administrative remedies.
....
Based on the above, we affirm the trial court's decision, without prejudice to Pope's right to file a new petition, upon the exhaustion of all administrative remedies available to him.
Id. at 253-54 (citation omitted).
[2]  See also Jamason v. State, 447 So.2d 892, 894 (Fla. 4th DCA 1983) ("The great writ has its origins in antiquity and its parameters have been shaped by suffering and deprivation. It is more than a privilege with which free men are endowed by constitutional mandate; it is a writ of ancient right."), approved, 455 So.2d 380 (Fla.1984).
[3]  See also Crane v. Hayes, 253 So.2d 435, 439 (Fla.1971) ("As a general rule, a habeas corpus proceeding is an independent action, legal and civil in nature, designed to secure prompt determination as to the legality of restraint in some form."); Sneed v. Mayo, 69 So.2d 653, 654 (Fla.1954) ("The purpose of a habeas corpus proceeding is to inquire into the legality of the petitioner's present detention."); Sylvester v. Tindall, 154 Fla. 663, 18 So.2d 892, 894 (1944) ("The general rule is that the object of the writ of habeas corpus is not to determine whether a person has committed a crime, or the justice or injustice of his detention on the merits, but to determine whether he is legally imprisoned or restrained of his liberty.").
