
202 S.W.3d 124 (2006)
William L. SMITH
v.
Virginia LEWIS, Warden, et al.
Supreme Court of Tennessee, at Cookeville.
May 31, 2006 Session.[1]
September 14, 2006.
Paul G. Summers, Attorney General & Reporter; Michael E. Moore, Solicitor General; Amy L. Tarkington, Deputy Attorney General; James Michael Taylor, District Attorney General; and James Pope, III, Assistant District Attorney General, for the Appellant, State of Tennessee.
Philip A. Condra, District Public Defender; B. Jeffery Harmon, Assistant Public Defender, for the Appellee, William L. Smith.
May 31, 2006 Heard at Boys' State.[1]


*125 OPINION
CORNELIA A. CLARK, J., delivered the opinion of the court, in which WILLIAM M. BARKER, C.J., and E. RILEY ANDERSON, ADOLPHO A. BIRCH, JR., and JANICE M. HOLDER, JJ., joined.
We granted permission to appeal to determine the extent to which a judgment order containing a sentence for rape of a child which suggests the possibility of early release is void and subject to correction *126 by writ of habeas corpus. On the facts of this case, we grant habeas corpus relief to the extent of vacating the illegal sentence but not to the extent of vacating the underlying conviction. We therefore affirm in part and reverse in part the Court of Criminal Appeals. This matter is remanded for further proceedings consistent with this opinion.
This case arises out of petitioner William L. Smith's application for a writ of habeas corpus following his plea of guilt to one count of child rape. The habeas corpus court conducted an evidentiary hearing and admitted into evidence Smith's Petition to Enter Plea of Guilty, the transcript of his plea hearing, a judgment order entered on September 8, 1997, and an amended judgment order entered on April 13, 1999. Those documents are in the record before this Court and indicate the following.
In September 1997, Smith pleaded guilty to a single count of rape of a child, a Class A felony. See Tenn.Code Ann. § 39-13-522(b) (Supp.1996).[2] The written petition to enter his plea indicates an agreed sentence of "15 yrs Range I." The prosecutor announced during the hearing that Smith "will plead to the count of child rape and will receive 15 years to serve." During the plea hearing, the trial judge asked Smith if he understood that he would "have to serve 85 percent of the [15 year] sentence before [he would be] eligible for parole?" Smith answered, "Yes, sir." Later in the hearing, the trial judge stated, "The Court has sentenced you to 15 years in Department of Correction at 85 percent." The prosecutor then pointed out that Tennessee Code Annotated section 40-35-501(i)(3) provides that a sentence for child rape cannot be reduced by fifteen percent on the basis of sentence reduction credits. The trial court acknowledged this provision and told Smith,
So you may very well have to serve day for day the fifteen years, and that would be less the time, I think you said eight months that you've already got, but that is a matter that will be addressed to the parole board. I have no control over that at all.
Smith replied, "Yes, sir, Your Honor." When the judge then asked Smith if he had any questions, Smith stated that he did not.
Following the plea hearing, the trial court entered its judgment order. This initial order indicates that Smith was sentenced to fifteen years of incarceration as a "Standard 30% Range 1" offender. That is, the initial order indicates that Smith would be eligible for release after serving thirty percent of his fifteen year sentence.[3] In April 1999, the trial court entered an "Amended Judgment" providing that Smith was sentenced to fifteen years "100% T.C.A. XX-XX-XXX." The "Special Conditions" section of the order provides further that Smith was sentenced "pursuant to TCA 40-35-501 and must serve at least 85% before being eligible for parole consideration." Thus, the amended judgment also reflects that Smith is eligible for early release.
In late 2003, Smith filed a petition for a writ of habeas corpus alleging that his sentence is illegal because sentences for child rape must be served day for day with no possibility of parole or early release. After conducting a hearing, the habeas corpus court denied relief, and Smith appealed. The Court of Criminal Appeals *127 determined that the amended judgment's reference to the possibility of release after service of eighty-five percent of the sentence was in contravention of an express statutory provision and an error "not clerical in nature." The Court of Criminal Appeals therefore reversed the habeas corpus court and granted relief upon finding that "the amended judgment reflects a void sentence for [Smith's] rape of a child conviction."
In its brief to this Court, the State concedes that Smith's sentence is illegal and void but argues that Smith's claim for habeas corpus relief is not yet ripe for adjudication. Alternatively, the State argues that the illegality of Smith's sentence does not render his conviction void.

STANDARD OF REVIEW
Whether to grant relief upon review of a petition for habeas corpus relief is a question of law. Hart v. State, 21 S.W.3d 901, 903 (Tenn.2000). Accordingly, our review is de novo with no presumption of correctness given to the findings and conclusions of the court below. Hogan v. Mills, 168 S.W.3d 753, 755 (Tenn.2005).

ANALYSIS
The writ of habeas corpus is guaranteed by article I, section 15 of the Tennessee Constitution. Although the writ is constitutionally guaranteed, it has been regulated by statute for more than 100 years. See Ussery v. Avery, 222 Tenn. 50, 432 S.W.2d 656, 657 (1968). Tennessee Code Annotated section 29-21-101 currently provides that "[a]ny person imprisoned or restrained of liberty, under any pretense whatsoever, except in cases [in which federal courts have exclusive jurisdiction], may prosecute a writ of habeas corpus, to inquire into the cause of such imprisonment and restraint." However, although the language of the statute is broad, the courts of this state have held that the writ may be granted "only when it appears upon the face of the judgment or the record of the proceedings upon which the judgment is rendered that a court lacked jurisdiction or authority to sentence a defendant or that the sentence has expired." Stephenson v. Carlton, 28 S.W.3d 910, 911 (Tenn.2000) (citing Archer v. State, 851 S.W.2d 157, 164 (Tenn.1993)). That is, the petitioner must demonstrate by a preponderance of the evidence that the judgment entered against him or her is "void," not merely "voidable." Hogan, 168 S.W.3d at 755.
In this case, Smith claims that the judgment entered against him is void because it encompasses an illegal sentence. As this Court has stated previously, "[a] void or illegal sentence is one whose imposition directly contravenes a statute." Id. (citing Stephenson, 28 S.W.3d at 911). In the context of habeas corpus proceedings, this Court has recognized that an illegal sentence renders the judgment void if the illegality is evident on the face of the judgment or the record of the underlying proceedings. See id.
In this case, both the original and amended judgments reflect Smith's conviction of rape of a child. Our criminal code provides that, "[n]otwithstanding any other provision of law to the contrary, a . . . child rapist . . . shall be required to serve the entire sentence imposed by the court undiminished by any sentence reduction credits such person may be eligible for or earn." Tenn.Code Ann. § 39-13-523(b) (Supp.1996) (emphasis added). That statute further declares that the provisions of section 40-35-501 relative to release eligibility status and parole "shall not apply to or authorize the release of a . . . child rapist . . . prior to service of the entire sentence imposed by the court." Id. at (c). Thus, the Criminal Sentencing Reform Act *128 of 1989 expressly prohibits Smith from any early release eligibility. In direct contravention of these provisions, the original judgment indicates that Smith is eligible for early release upon serving thirty percent of his sentence. The amended judgment indicates that Smith is eligible for early release upon serving eighty-five percent of his sentence. The judgment in both its original and amended forms therefore contains on its face an illegal sentence.
The trial court's error in this regard arose out of an ambiguity in Tennessee Code Annotated section 40-35-501 (1997). That statute provides that persons convicted of certain enumerated crimes, including rape of a child, "shall serve one hundred percent (100%) of the sentence imposed by the court less sentence credits earned and retained. However, no sentence reduction credits authorized by § 41-21-236, or any other provision of law, shall operate to reduce the sentence imposed by the court by more than fifteen percent (15%)." Id. § 40-35-501(i)(1) (emphasis added). Thus, the provision appears to contemplate that a sentence for rape of a child may be reduced up to fifteen percent for sentence credits. However, the statute also provides that the foregoing language shall not be construed "as affecting, amending or altering the provisions of § 39-13-523, which requires child rapists . . . to serve the entire sentence imposed by the court undiminished by any sentence reduction credits." Id. at (i)(3). It is unclear why the legislature chose to include in subsection (i)(2) rape of a child as one of the crimes for which sentence credits could be earned to shorten service by up to fifteen percent. Nevertheless, it is clear from the other relevant statutory language that sentences imposed for rape of a child must be served one hundred percent.
We have no choice, then, but to conclude that Smith's sentence is illegal, and that portion of the judgment imposing sentence is void upon its face.
In its brief to this Court, the State argues for the first time in this case that, notwithstanding his illegal sentence, Smith's right to seek habeas corpus relief in this matter will not "ripen" until he has served eighty-five percent of his sentence. We disagree. The judgment entered against him, in both its original and amended forms, contains an illegal sentence which is void on its face. The illegal and void character of the sentence inhered upon its entry: it will not spring into being only after Smith has served eighty-five percent of his sentence. Smith is therefore entitled to pursue his habeas corpus claim.
The question of remedy remains. The State urges us to differentiate between Smith's conviction and his sentence and to find only his sentence void. Accordingly, the State would have us remand this matter to the original trial court for the imposition of the agreed-upon term of fifteen years at one hundred percent service. The State argues that Smith's conviction is not void, but merely voidable, because it requires proof beyond the face of the record to demonstrate that, but for the release eligibility he was accorded by the trial court, Smith would not have pleaded guilty. Because Smith's conviction is voidable rather than void, the State posits, he is not entitled to habeas corpus relief from this aspect of the judgment.
Under the unique facts of this case, we agree with the State on this issue. Because this is a habeas corpus proceeding, we are limited to considering the face of the judgment and the record of the proceedings upon which the judgment was rendered. The record of the proceedings resulting in the erroneous judgment and *129 amended judgment include Smith's written plea document and the transcript of the plea hearing. The written plea document contains no specific reference to any early release eligibility. Nor was any agreement as to early release eligibility announced to the court during the plea hearing. Rather, the trial court sua sponte raised the issue. In response, the prosecutor attempted to correct the trial court, pointing out the statute forbidding early release eligibility for those convicted of child rape. Significantly, defense counsel made no reply to the prosecutor's objection. The prosecutor's objection, together with defense counsel's silence on this point, makes clear that there was no agreement as to Smith's early release eligibility as, indeed, there should not have been.
Smith responds that the illegal and void character of his sentence renders his entire judgment void, including his conviction. Smith relies on this Court's decisions in McLaney v. Bell, 59 S.W.3d 90 (Tenn.2001), and McConnell v. State, 12 S.W.3d 795 (Tenn.2000). Those cases are, however, distinguishable.
In McLaney, the defendant received concurrent sentences on multiple convictions "[a]s part of the plea agreement arranged with the district attorney." 59 S.W.3d at 92. The defendant subsequently challenged the legality of his sentence in habeas corpus proceedings on the grounds that our sentencing scheme required his sentences to be served consecutively. This Court remanded the case for a determination of whether the record underlying the conviction demonstrated on its face that the defendant had been on bail when he committed the offenses, thereby making consecutive service mandatory. Id. at 95. In that event, we held, the defendant had the option of leaving his plea intact, in which event resentencing was required, or the defendant could withdraw his plea, in which event the pending prosecution would be recommenced. Id. at 95-96. Similarly, the McConnell case involved an agreed-to sentence that was illegal. This Court held that, "[c]onsequently, the sentence entered by the trial court is illegal and must be set aside." 12 S.W.3d at 800 (emphasis added) (footnote omitted). We determined that,
[o]n remand, the trial court may impose a sentence that is mutually agreeable to the State and appellant, so long as the sentence is available under the 1989 Act. If an agreement is not reached, though, appellant may withdraw his guilty plea and proceed to trial on the original charges.
Id. Thus, McLaney and McConnell stand for the proposition that, when a defendant bargains for and receives an illegal sentence, the defendant will have the option of resentencing on the original plea or withdrawal of the plea and recommencement of the prosecution. See also Henderson v. State ex rel. Lance, 220 Tenn. 520, 419 S.W.2d 176, 178-79 (1967) (holding that defendant was entitled to withdraw guilty plea upon habeas corpus proceedings where he pled guilty in exchange for an illegal sentence). These cases recognize that where "the sentence bargained for is otherwise illegal, the defendant is entitled to withdraw the plea." McLaney, 59 S.W.3d at 95. To hold otherwise would inflict upon a misled defendant a sentence to which he or she did not agree. On the other hand, allowing a misled defendant to withdraw his or her plea upon the discovery that his or her bargained-for sentence is illegal will encourage trial judges and prosecutors to ensure that only legal sentences are bargained for and imposed.
In this case, however, the sentence Smith actually bargained for  fifteen years "to serve"  was legal. Thus, we find more to the point this Court's decisions in the Stephenson cases. There, the *130 defendant was convicted by a jury of first degree murder and sentenced to death. See State v. Stephenson, 878 S.W.2d 530, 534 (Tenn.1994). On appeal, the defendant's conviction was affirmed, but his death sentence was reversed and the matter remanded for resentencing. Id. On remand, the defendant and the State reached an agreement as to the defendant's sentence. See Stephenson v. Carlton, 28 S.W.3d 910, 911 (Tenn.2000). This agreed-to sentence was, however, illegal. Id. at 912. The defendant later filed for habeas corpus relief and, upon finding the sentence illegal and void, this Court granted relief. Id. Significantly, we left intact the defendant's conviction for first degree murder, as it was not a product of a bargained-for, but illegal, sentence. See State v. Stephenson, 195 S.W.3d 574, 593 (Tenn. 2006) (noting that, although the habeas corpus court on remand entered a final judgment declaring the defendant's sentence null and void, the defendant's first degree murder conviction "remained valid and in effect"). The Stephenson cases make clear that, where the illegality infects only the sentence, only the sentence is rendered void and habeas corpus relief may be granted to the extent of the sentence only. In such cases, the underlying conviction remains intact.
As set forth above, the record in this case does not demonstrate on its face that the illegal provision of early release eligibility was a bargained-for element of Smith's plea. Smith's plea of guilt and the resulting conviction are therefore not based on an illegal sentence and, consequently, are not infected with the illegality. Rather, the record in this case demonstrates that the trial court made an error sua sponte and independent of the plea bargain. Under these circumstances, we hold the illegal sentence to be null and void. Smith's conviction, however, remains intact.

CONCLUSION
We affirm the Court of Criminal Appeals insofar as it held Smith's sentence, as indicated on the judgment and amended judgment, illegal and void upon its face. We reverse the Court of Criminal Appeals insofar as it granted relief as to Smith's conviction. Accordingly, we grant habeas corpus relief by vacating Smith's sentence and remanding the matter to the original court of conviction for entry of a corrected judgment setting forth Smith's conviction of rape of a child, entered September 8, 1997,[4] and sentencing him to fifteen years of incarceration to be served one hundred percent with no provision for early release eligibility. The corrected judgment shall further set forth Smith's pre-trial jail credits.[5]
It appearing that Smith is indigent, the costs of this cause are taxed to the State of Tennessee.
NOTES
[1]  Oral argument was heard in this case on May 31, 2006, in Cookeville, Putnam County, Tennessee, as part of this Court's S.C.A.L.E.S. (Supreme Court Advancing Legal Education for Students) project.
[2]  Smith committed the offense in 1996.
[3]  Generally, defendants sentenced as Range I standard offenders become eligible for early release after serving thirty percent of their sentence. See Tenn.Code Ann. § 40-35-501(c).
[4]  Although the original judgment correctly reflects the date of entry as September 8, 1997, the amended judgment erroneously sets forth the date of entry of the plea as September 8, 1999.
[5]  The original judgment reflects Smith's pre-trial jail credit period as beginning on February 7, 1997, and ending on September 8, 1997. The amended judgment erroneously omits this information.
