ON WRIT OF CERTIORARI
LAMAR, Justice,for the Court:
¶ 1. In September 2007, a Lafayette County grand jury returned a two-count indictment against Albert Joiner. Count I charged Joiner with felony flight, and Count II charged Joiner with being a felon in possession of a deadly weapon. Although Count II listed several prior felonies by Joiner, the indictment did not charge him as a habitual offender. In a separate case in Lafayette County, Joiner had a pending indictment for armed robbery as a habitual offender under Mississippi Code Section 99-19-83, an enhancement which carries a sentence of life without parole.
¶ 2. Pursuant to a plea agreement, the State agreed to dismiss Count II in the second indictment, the felon-in-possession charge, and reduce the armed-robbery charge to strong-armed robbery if Joiner would plead guilty to felony flight and strong-armed robbery as a “lesser habitual offender” under Mississippi Code Section 99-19-81.1 Pursuant to this negotiated *158plea agreement, Joiner pleaded guilty to felony flight and strong-armed robbery and was sentenced to a total of nineteen years as a Section 99-19-81 habitual offender.
¶ 3. Joiner subsequently filed a motion for post-conviction relief in the Lafayette County Circuit Court, arguing that the trial judge had erred in sentencing him as a habitual offender for the felony-flight charge, because the indictment failed to charge him as a habitual offender.2 Joiner also argued that the State had failed to prove that he had been “convicted twice previously” of any felony. He requested that the trial judge vacate his sentence for the felony-flight charge and set a hearing date for resentencing. The trial judge summarily denied his petitions,3 and Joiner appealed.
¶ 4. The case was assigned to the Court of Appeals, which affirmed the trial-court judge. See Joiner v. State, 61 So.3d 171 (Miss.Ct.App.2010). The Court of Appeals held that, because Joiner voluntarily had pleaded guilty to the reduced charge of “felony fleeing lesser habitual,” he was “aware of his eligibility for sentencing as a habitual offender.” Joiner, 61 So.3d at 173. The Court of Appeals also held that Joiner was not denied effective assistance of counsel, pointing out that his attorney had negotiated a reduced sentence of nineteen years as a habitual offender under Section 99-19-81, rather than a life sentence as a habitual offender under Section 99-19-83. Id. at 173.
¶ 5. Joiner filed a petition for writ of certiorari, which we granted, arguing the same issues that he argued before the trial court and the Court of Appeals. Although we agree with the Court of Appeals’ disposition, we granted certiorari to examine Joiner’s claim that his sentence as a habitual offender for felony flight is invalid because the indictment failed to charge him as a habitual offender. We limit our discussion to that issue. See Miss. R.App. P. 17(h).
¶ 6. Joiner is correct that a defendant has a right to be indicted as a habitual offender before he properly may be convicted and sentenced as a habitual offender. But the right to be indicted as a habitual offender is a right that can be waived, along with many others, by a knowing and voluntary guilty plea. Because we find that Joiner’s knowing and voluntary guilty plea waived his right to contest this deficiency in the indictment, we agree with the Court of Appeals and affirm the trial court’s denial of his petition for post-conviction relief.
¶ 7. It is well-settled that a knowing and voluntary guilty plea waives certain constitutional rights, among them the privilege against self-incrimination, the right to confront and cross-examine the State’s witnesses, the right to a jury trial, and the right to have the State prove each element of the offense beyond a reasonable doubt. Jefferson v. State, 556 So.2d 1016, 1019 (Miss.1989) (citations omitted). And beyond the constitutional rights that may *159be waived, “the law is settled that with only two exceptions, the entry of a knowing and voluntary guilty plea waives all other defects or insufficiencies in the indictment.” Conerly v. State, 607 So.2d 1158, 1156 (Miss.1992) (citation omitted) (emphasis added). A guilty plea does not waive an indictment’s failure to charge an essential element of the crime, and it does not waive lack of subject matter jurisdiction, but neither of these exceptions is at issue here. Id.
¶ 8. The plea colloquy reveals that Joiner’s guilty plea was knowing and voluntary. The trial judge questioned Joiner thoroughly as to the voluntariness of his plea, asking Joiner if his signature appeared on the plea petitions, if he had been given an opportunity to discuss the petitions with his attorney, if his attorney had explained the petitions to him, if he was satisfied with his attorney, and if he understood all the rights he was giving up by pleading guilty. Joiner answered affirmatively to all of the judge’s questions. Joiner also denied being under the influence of anything that would impair him, having any type of disability, or being threatened or promised anything in exchange for his guilty pleas.
¶ 9. The plea colloquy also reveals that Joiner was well aware that he was pleading as a habitual offender:
Court: Mr. Joiner, in Cause Number LK07-133, the Court has before it a petition to enter a plea of guilty as a lesser habitual offender to the crime of strong armed robbery. Is that correct?
Joiner: Yes, sir.
Court: And in Cause Number LK07-399, which is, of course, also the State of Mississippi versus Albert Joiner, Jr., I have a petition to enter plea of guilty to the crime of felony fleeing of a law enforcement officer as a lesser habitual offender. Is that also correct?
Joiner: Yes, sir.
[[Image here]]
Court: And in each of these two cases also are you telling me that you realize and understand that you qualify for habitual offender status and that you’re going to be sentenced, if the Court accepts your guilty plea, as what we call a lesser habitual offender which will mean that the time that you receive you will have to serve day-for-day? Do you understand that?
Joiner: Yes, sir.
[[Image here]]
Court: Now, if the Court accepts your guilty plea in these two cases, they will go on your record and they will be added to the felonies you already have on your record. You already qualify as a habitual offender, and you will continue to qualify as a habitual offender. Once you get out of the penitentiary, any other felonfies] you’re charged with, you can take these charges as well as your other prior felonies, and use them against you to make your punishment worse, to enhance it. Do you understand what I’m telling you?
Joiner: Yes, sir.
Court: I expect to receive a recommendation in your case, and that’s going to be that the court sentence ... you to habitual time. It’s 15 years to serve in one case and 4 years to serve in the other case consecutive habitual offender day-for-day. Do you understand that recommendation?
Joiner: Yes, sir.
Court: And you will be required to serve all 19 of those years?
Joiner: Yes, sir.
(Emphasis added.)
¶ 10. We find that Joiner knowingly and voluntarily pleaded guilty to the *160charge of felony flight as a Section 99-19-81 habitual offender. We further find that a knowing and voluntary guilty plea waives an indictment’s failure to include habitual offender status, and we therefore affirm the trial court’s denial of Joiner’s petition for post-conviction relief as well as the Court of Appeals’ affirmance of that judgment.
¶ 11. AFFIRMED.
WALLER, C.J., CARLSON AND DICKINSON, P.JJ., RANDOLPH AND PIERCE, JJ., CONCUR. CHANDLER, J., DISSENTS WITH SEPARATE WRITTEN OPINION JOINED BY KITCHENS, J. KING, J., NOT PARTICIPATING.. Section 99-19-81 mandates that a defendant who has been twice previously convicted of a felony and sentenced to separate terms of one year or more be sentenced to the maxi*158mum term of imprisonment for any subsequent felonies. It differs from Section 99-19-83 in that it does not mandate life in prison for any subsequent felony. Compare Miss. Code Ann. § 99-19-81 (Rev.2007) with Miss. Code Ann. § 99-19-83 (Rev.2007).
. Joiner's conviction for strong-armed robbery is not before us. That conviction was the subject of a separate motion for post-conviction relief which was denied by the trial court and affirmed on appeal by the Court of Appeals in Joiner v. State, 32 So.3d 542 (Miss.Ct.App.2010).
. Joiner also filed an amended motion for post-conviction relief, adding a claim of ineffective assistance of counsel.