The director of the Department of Corree-tions (director) initiated this appeal following the Crowley County District Court's grant of Ralph Horton's petition for writ of habeas corpus. As discussed below, at the hearing on Horton's petition, the director had agreed with Horton that the Crowley County District Court should both hear the petition and grant the relief requested therein.
We are unpersuaded by the director's assertion on appeal that the Crowley County District Court (the habeas court) did not have jurisdiction to hear Horton's petition and grant the relief requested because Horton was first required to exhaust his remedies pursuant to Crim. P. 85. In reaching this conclusion, we are first required to address the issue of subject-matter jurisdiction, both generally and in the context of the writ of habeas corpus. We then consider the doctrine of exhaustion of legal remedies, and, after reviewing our prior precedent and relevant precedent from other jurisdictions, conclude that the director's exhaustion of remedies argument is not jurisdictional and, as a result, was waivable and in this case actually waived. Finally, we discuss the doctrine of invited error and conclude that the director invited the error by agreeing that Horton was entitled to the relief he requested. Accordingly, we affirm the Crowley County District Court.
I. Facts and Procedure
On October 22, 1997, Horton was convicted in the District Court for the City and County of Denver (the trial court) of the sale or possession of a schedule I or II controlled substance, a class 3 felony. See $ 18-18-405(2)(a)(I), 6 C.R.S. (2001). On December 1, 1997, the trial court sentenced Horton to community corrections for two years. After community corrections rejected Horton, the trial court resentenced Horton to two years in the Department of Corrections (DOC). The trial court also granted Horton credit for 205 days of presentence confinement. On February 12, 1998, the trial court amended the mittimus in Horton's case to include the mandatory parole period. Specifically, the mittimus was amended to include the language, "any term of parole authorized by Section CRS 18-1-105(1)(a@)(V)." 1 Horton was paroled on February 3, 1999. However, he violated his parole and was thus returned to the DOC on June 8, 1999.
On October 22, 1999, Horton filed a pro se petition for writ of habeas corpus in the Crowley County District Court. Horton's petition claimed that he was entitled to immediate release because, although he had fully served his sentence, the DOC was illegally refusing to release him. More specifically, Horton asserted that he was entitled to immediate release because he had served his entire two-year sentence before his parole was revoked.
The habeas court issued the writ, and a hearing was held on November 2, 1999. In his return to the writ of habeas corpus, and at the habeas corpus hearing, the director *614argued that the habeas court did not have subject-matter jurisdiction over the case. In support of this argument, the director stated that Horton had previously filed a Crim. P. 35(a) motion to correct an illegal sentence in the trial court, which was still pending at the time of the hearing. The director further contended that the habeas court lacked subject-matter jurisdiction because Horton had previously filed a Crim. P. 35(c) motion that had been denied and was on appeal to the court of appeals as No. 98CA9Q4.2 The habe-as court accepted the director's arguments and denied the writ of habeas corpus on November 3, 1999.
On December 2, 1999, the trial court denied Horton's Crim. P. 85(a) motion on the grounds that it did not have subject-matter jurisdiction over the case because the court of appeals had such jurisdiction.3 According ly, Horton filed a motion for reconsideration with the habeas court on December 10, 1999. The director responded to the motion for reconsideration by agreeing with Horton that the habeas court could now properly hear the matter and that the relief sought by Horton was proper. Specifically, the director's response stated:
4. Based on close review of [Horton's] pending appeal before the Colorado Court of Appeals and [Horton's] request for relief upon the petition for writ of habeas corpus before this Court, the issues are not the same. Therefore the [director] agrees with [Horton] that this Court now has jurisdiction to consider the issues addressed in the petition for writ of habeas corpus.
5. Based on C.R.S. § 17-22.5-808 and People v. Mark A. Johnson, 97CA214, the [director] does not object to this Court granting [Horton's] request for relief.
THEREFORE, [the director] does not oppose [Horton's] request for habeas relief,
Relying on the director's representations in the response to the motion to reconsider, the habeas court granted Horton the relief he requested, and on January 19, 2000, ordered the DOC to release him immediately. The director appealed this judgment to us.4 For the reasons discussed below, we affirm.
II. Analysis
The director asserts two arguments on appeal. First, he contends that the habeas court lacked subject-matter jurisdiction to grant the relief requested in Horton's petition for writ of habeas corpus after the trial court had denied his Crim. P. 85(a) motion. More specifically, the director asserts that a defendant must exhaust all of his legal remedies under Crim. P. 35 before filing a petition for writ of habeas corpus. Second, he asserts that, if we find that subject-matter jurisdiction was proper in the habeas court, that court erroneously decided the merits of Horton's petition for writ of habeas corpus by granting the relief requested. The director asserts the second argument for the first time in this appeal.
*615A. Subject-Matter Jurisdiction
Upon Horton's initial filing of his petition for writ of habeas corpus, the director asserted that the habeas court did not have subject-matter jurisdiction. However, in response to Horton's motion to reconsider, the director reversed his position, agreeing with Horton that the habeas court did have jurisdiction. The director further stated that he did not object to the court granting the relief Horton requested, which was immediate release from custody.
1. Subject-Matter Jurisdiction Generally
Subject-matter jurisdiction "concerns 'the court's authority to deal with the class of cases in which it renders judgment." " Closed Basin Landowners Ass'n. v. Rio Grande Water Conservation Dist., 734 P.2d 627, 636 (Colo.1987) (quoting In re Marriage of Stroud, 631 P.2d 168, 170 (Colo.1981)). A court has subject-matter jurisdiction if "the case is one of the type of cases that the court has been empowered to entertain by the sovereign from which the court derives its authority." Paine, Webber, Jackson & Curtis, Inc. v. Adams, 718 P.2d 508, 513 (Colo.1986).
The director properly asserts that subject-matter jurisdiction is not an issue waivable by the parties: "Jurisdiction is not conferred or taken away from a court based on the position of a party regarding the court's jurisdiction; instead, jurisdiction concerns the court's authority to decide the class of cases in which it renders judgment and is determined as a matter of law." Winslow Constr. Co. v. City & County of Denver, 960 P.2d 685, 690 (Colo.1998). However, as explained below, the director conflates subject-matter jurisdiction with the doctrine of exhaustion of remedies. Accordingly, the director did not attempt to confer subject-matter jurisdiction upon the habeas court contrary to law, as he now contends. Instead, the director merely waived the opportunity to present the exhaustion of remedies argument he attempts to present in this appeal by agreeing to the relief sought in Horton's habeas petition.
2. Subject-Matter Jurisdiction and the Writ of Habeas Corpus
Contrary to the director's assertion, the habeas court did not lack subject-matter jurisdiction. In fact, all district courts in this state have subject-matter jurisdiction to entertain and decide habeas corpus cases. See § 1845-101, 5 CRS. (2001) Duran v. Price, 868 P.2d 375, 378 (Colo.1994); Stilley v. Tinsley, 158 Colo. 66, 86, 385 P.2d 677, 688 (1963). "Since it is the great writ of freedom in Anglo-American jurisprudence, it is not to be hedged or in any way circumscribed with technical requirements." - People ex rel. Wyse v. Dist. Court, 180 Colo. 88, 92, 503 P.2d 154, 156 (1972). Further, the Colorado Constitution provides that "[the privilege of the writ of habeas corpus shall never be suspended, unless when in case of rebellion or invasion, the public safety may require it." Colo. Const. art. II, § 21.
There are, however, some limits to the issues that may be raised in a petition for writ of habeas corpus and heard by a habeas court. The sole issue for resolution in a habeas corpus proceeding is whether the petitioner is being unlawfully detained. See, e.g., Graham v. Gunter, 855 P.2d 1384, 1385 (Colo.1993). Thus, a habeas court may not "inquire into the legality or justice of a judgment or decree of a court legally constituted, in any other manner." $ 13-45-1088). In other words, a habeas court may only hear matters presented in a properly pleaded petition for habeas,5 namely whether the sentence is void or illegal. See Graham, 855 P.2d at 1385; Mulkey v. Sullivan, 753 P.2d 1226, 1232 (Colo.1988); Johnson v. Black, 137 Colo. 119, 124, 322 P.2d 99, 103 (1958).
As a result of our cases articulating the limitations of petitions for habeas corpus, we have clearly defined the contours of habeas corpus with regard to some particular and discrete issues. For example, we have held *616that a petitioner's allegation that his confession was coerced is not a justiciable issue in a habeas corpus proceeding, Shearer v. Patterson, 159 Colo. 319, 320, 411 P.2d 247, 248 (1966); that an alleged speedy trial violation is not properly asserted in a petition for writ of habeas corpus, Dodge v. People, 178 Colo. 71, 73, 495 P.2d 213, 214 (1972), that an attempt to restore good time credits is not properly asserted in a petition for writ of habeas corpus, Kodama v. Johnson, 786 P.2d 417, 419-20 (Colo.1990), and that an ineffective assistance of counsel claim is not properly asserted in habeas corpus proceeding, Tuller v. Neal, 886 P.2d 279, 279 (Colo.1994). Further, we have held that in some cireum-stances, a petitioner for the writ may request relief that falls short of complete release from custody. See, e.g., Marshall v. Kort, 690 P.2d 219, 222-23 (Colo.1984), rev'd in part on other grounds, Jacobs v. Carmel, 869 P.2d 211 (Colo.1994).
Beyond these kinds of specific issues that do not go to the issue of the lawfulness of the petitioner's continued restraint, however, our prior holdings also stand for the proposition that habeas corpus jurisdiction is broad when a habeas court is presented with a properly pleaded petition for the writ. For example, the Stilley court stated that "Itlo impose conditions on issuance of the writ, such as exhausting other available remedies in situations such as we have here, is pro tanto a suspension of the writ.... We are not unmindful of Rule 35 of Colorado Rules of Criminal Procedure ... and observe that that rule in no way seeks to impose any conditions on the issuance of habeas corpus writs-it only affords a remedy for those seeking a proper sentence, a remedy which the prisoner may seek or not seek at his election." Stilley, 153 Colo. at 86-87, 385 P.2d at 688-89. Further, "open-ended relief accords with the essential purpose of the writ: 'The very nature of the writ demands that it be administered with the initiative and flexibility to insure that miscarriages of justice within its reach are surfaced and corrected." Kort, 690 P.2d at 222 (quoting Harris v. Nelson, 394 U.S. 286, 291, 89 S.Ct. 1082, 22 L.Ed.2d 281 (1969)).
3. Horton's Petition for Writ of Habeas Corpus
In this case, Horton's petition for ha-beas corpus alleged, in pertinent part, that his continued incarceration was void and illegal. In determining what constitutes a "void" or "illegal" judgment for purposes of subject-matter jurisdiction vis-a-vis the writ of habeas corpus, the allegation that a petitioner is entitled to immediate release has been recognized by this court as a proper basis for petitioning for the writ.6 See, e.g., Johnson v. Gunter, 852 P.2d 1263, 1265 (Colo.1993); Cardiel v. Brittain, 833 P.2d 748, 751 (Colo.1992); Black, 137 Colo. at 123-24, 322 P.2d at 103. Accordingly, the habeas court had subject-matter jurisdiction to hear and decide Horton's petition.
B. Exhaustion of Remedies
Our determination that the habeas court had subject-matter jurisdiction because Horton filed a properly pleaded habeas corpus petition does not end our inquiry. The director's argument regarding jurisdiction is more complex than the straightforward assertion that Horton's allegations were improperly pleaded in a habeas petition. The director contends not only that a petitioner must file a properly pleaded petition for the writ, but he also argues that a petitioner must exhaust all remedies under Crim. P. 85 before a habeas court has subject-matter jurisdiction to consider a petition for writ of habeas corpus. The director thus argues *617that the alleged requirement of exhaustion of remedies is jurisdictional; a petitioner must, according to the director's argument, exhaust all remedies under Crim. P. 85 before jurisdiction could be triggered in a habeas court.
1. Exhaustion of Remedies is Not Jurisdictional
The director's argument that exhaust, ing remedies under Crim. P. 35 is a condition precedent to a habeas court having jurisdiction is erroneous. As discussed above, all district courts have subject-matter jurisdiction to hear petitions for writs of habeas corpus. Whether a petitioner must file a Crim. P. 35 motion before, or in lieu of, a petition for the writ goes to the issue of whether a habeas court should exercise that jurisdiction, not whether the habeas court has such jurisdiction in the first instance.
The several observations drawn from our prior holdings regarding the nature and extent of a habeas court's jurisdiction lend support to our conclusion that the director's exhaustion of remedies argument is misplaced. See discussion in part IL.A.2, supra. Such broad habeas corpus jurisdiction suggests that district courts presented with clear-cut habeas petitions may grant or deny such petitions notwithstanding the availability of relief under Crim. P. 35; "Prohibition does not lie, in this court or in district courts, to prevent courts having jurisdiction of habe-as corpus ... from proceeding to grant or deny the relief requested." Stilley, 153 Colo. at 88, 385 P.2d at 689. Our precedent thus supports the general proposition that habeas corpus jurisdiction is broad, as well as our conclusion that any possibility that exhaustion of remedies might be required is not jurisdictional.
United States Supreme Court precedent supports our conclusion. That Court has held that any requirement of exhaustion of remedies in the habeas corpus context is not jurisdictional. See, e.g., Castille v. Peoples, 489 U.S. 346, 349, 109 S.Ct. 1056, 103 L.Ed.2d 380 (1989); Granberry v. Greer, 481 U.S. 129, 131, 107 S.Ct. 1671, 95 L.Ed.2d 119 (1987); Bowen v. Johnston, 306 U.S. 19, 27, 59 S.Ct. 442, 83 L.Ed. 455 (1939).7 In reaching this conclusion, the Court reasoned that the exhaustion of remedies doctrine is based on the principle of comity, rather than on the jurisdictional power of federal courts to entertain petitions for habeas corpus. Castille, 489 U.S. at 349, 109 S.Ct. 1056; Granberry, 481 U.S. at 134, 107 S.Ct. 1671. Therefore, the state may waive the argument that a petitioner has failed to exhaust his remedies. Granberry, 481 U.S. at 134, 107 S.Ct. 1671; see also Brown v. Maass, 11 F.3d 914, 914-15 (9th Cir.1993). Further, at least one state supreme court has held that exhaustion of remedies in the habeas corpus context is not jurisdictional, See In re Wallace, 3 Cal.3d 289, 90 Cal.Rptr. 176, 475 P.2d 208, 210 (1970).
2. The Director Waived the Exhaustion of Remedies Argument
Accordingly, the director's assertion that Horton must exhaust all remedies under Crim. P. 85 before initiating a habeas proceeding is not jurisdictional in nature.8 *618Because it does not go to the existence of jurisdiction of the court, but rather to whether the court should elect to exercise that jurisdiction, the director's argument regarding the doctrine of exhaustion of legal remedies in habeas corpus cases was waivable by the parties In this case, counsel for the director did just that when he conceded, upon the habeas court's reconsideration of Horton's petition, that the habeas court should grant Horton's requested relief, The director's conflation of the concept of subject-matter jurisdiction and the doctrine of exhaustion of remedies renders his request for relief improper.
C. The Invited Error Doctrine
The director's request for relief is improper under the doctrine of invited error. In essence, the director reversed his previous position and specifically conceded that the habeas court should hear the case and grant the relief requested by Horton. In his reply brief, the director expressly admits that concession is contrary to the argument he makes to us. The doctrine of invited error bars the director from changing course in this way.
1. The Invited Error Doctrine Generally
The doctrine of invited error captures the principle that "a party may not complain on appeal of an error that he has invited or injected into the case; he must abide by the consequences of his acts." People v. Zapata, 779 P.2d 1307, 1309 (Colo.1989). The doctrine has been described as "an application of the estoppel principle." Norgart v. Upjohn Co., 21 Cal.4th 383, 87 Cal.Rptr.2d 453, 981 P.2d 79, 92 (1999); see also Missouri, Kan. & Tex. Railway Co. v. Eyer, 96 Tex. 72, 70 S.W. 529 (1902) ("The [doctrine of invited error] is but a deduction from the doctrine of estoppel."); Graham v. Graham, 41 Wash.2d 845, 252 P.2d 313, 316 (1953) ("[The doctrine of invited error ... arises as one phase of estoppel or waiver of a right to take a position inconsistent with that initially taken."). Although a species of the equitable doctrine of estoppel, the invited error doctrine is narrower than estoppel. Specifically, the invited error doctrine is triggered by actions taken by a party in the course of litigation. In contrast, estoppel is usually triggered by the conduct underlying a cause of action brought before a court. Thus, the doctrine of invited error, while encompassing the conceptual basis of estop-pel, is properly invoked only against actions taken in the course of litigation:
Invited error is a cardinal rule of appellate review applied to a wide range of conduct. It ... prevents a party from inducing an inappropriate or erroneous [ruling] and then later seeking to profit from that error. The idea of invited error is ... to protect principles underlying notions of judicial economy and integrity by allocating appropriate responsibility for the inducement of error. Having induced an error, a party in a normal case may not at a later stage of the [proceedings] use the error to set aside its immediate and adverse consequences.
Roberts v. Consolidation Coal Co., 208 W.Va. 218, 539 S.E.2d 478, 488 (2000). Accordingly, the doctrine "[oJperates to bar a disappointed litigant from arguing on appeal that an adverse decision below was the product of error, when that party urged the lower court to adopt the proposition now alleged to be error." Brett v. Great Am. Rec., 144 N.J. 479, 677 A.2d 705, 717 (1995).
*619We have held that the doctrine of invited error even applies to errors implicating constitutional rights. Zapata, 779 P.2d at 1309 (citing Geer v. Alaniz, 138 Colo. 177, 181, 331 P.2d 260, 262 (1958)). The doctrine has been applied against both plaintiffs and defendants in both criminal and civil cases. See, e.g., Palmer v. Gleason, 154 Colo. 145, 147-48 389 P.2d 90, 91 (1964) (invoking the doctrine against a defendant in a civil case); People v. Shackelford, 182 Colo. 48, 50, 511 P.2d 19, 20 (1973) (invoking the doctrine against a defendant in a criminal case); Leister v. Wells, 300 Mo. 262, 254 S.W. 75 (1923) (invoking the 'doctrine against a plaintiff in a civil case).
Further, the doctrine is not limited to cases in which a party requests that the court take a particular action and then later complains of that same action. Hansen v. State Farm Mut. Auto. Ins. Co., 957 P.2d 1380, 1384-85 (Colo.1998). The doctrine applies where one party expressly acquiesces to conduct by the court or the opposing party.9 See, e.g., id. at 1385 (holding that the invited error doctrine applied where the trial court rejected a jury instruction tendered by defendant State Farm and State Farm elected not to tender a replacement instruction, thereby implicitly agreeing with the court's action); Boothe v. People, 814 P.2d 372, 376 (Colo.1991) (Lohr, J., concurring) (holding that the invited error doctrine applied where defendant's counsel "was fully advised and requiesced in the court's response to the jury's question" and "did agree that the appropriate response" was the response suggested by the court); People v. Gregor, 26 P.3d 530, 522 (Colo.App.2000) (holding that the invited error doctrine applied where the defendant acquiesced to a jury instruction); People v. Raglin, 21 P.3d 419, 423 (Colo.App.2000) (holding that the invited error doctrine applied where the defendant expressly declined the trial court's offer to replace a juror with an alternate juror). Thus, the fact that the director expressly acquiesced to the ha-beas court hearing the petition for writ of habeas corpus and granting the relief sought by Horton warrants application of the doe-trine of invited error.10
2. The Application of the Invited Error Doctrine to this Case
The facts of this case present no reason for us to depart from our longstanding recognition and application of the invited error rule. To hold otherwise would improperly reward the director for conduct we have not previously overlooked when undertaken by a defendant. See, e.g., Zapata, 779 P.2d at 1307 ("On certiorari, the prosecution asserts the invited error doctrine bars appellate review of error in a jury instruction, where the instruction was drafted and tendered by the defense. We conclude that it does."); see also Hansen, 957 P.2d at 1384-85; People v. Montoya, 928 P.2d 781, 784 (Colo.App.1996).
Because consideration of the merits of the director's arguments is improper based on the doctrine of invited error, we do not address whether exhaustion of remedies under Crim. P. 85 may be required in some cireum-stances before a petition for writ of habeas corpus may be filed. Compare Stilley, 153 Colo. at 86-87, 385 P.2d at 688-89 ("To impose conditions on issuance of the writ, such as exhausting other available remedies in situations such as we have here, is pro tanto a suspension of the writ.") with Moody v. Corsentino, 843 P.2d 1355, 1361 (Colo.1993) ("Generally, a court will not consider a request for habeas corpus relief unless the petitioner has no other form of relief available.").
*620III, - Conclusion
We conclude that because the director agreed that the habeas court should both hear the petition for habeas corpus and grant the relief requested therein, the doctrine of invited error now precludes him from challenging either of those issues on appeal. Accordingly, we affirm the judgment of the Crowley County District Court.
Justice COATS specially concurs.