We granted en banc review of this appeal to determine under what circumstances a defendant can effectively waive appellate rights as part of a valid plea agreement. In this case, John R. Andis entered into a plea agreement that significantly limited his appellate rights.2 In spite of the waiver in his plea agreement, Mr. Andis now appeals certain conditions of his supervised release, claiming the conditions constitute an illegal sentence and therefore the waiver does not bar him from bringing this appeal.
*888A panel of this Court originally remanded this case to the district court3 for further consideration of the conditions of Mr. Andis’s supervised release. See United States v. Andis, 277 F.3d 984 (8th Cir.2002). We vacated the panel decision and ordered an en banc rehearing. We now hold that although a defendant generally can waive appellate rights, such a waiver is subject to certain limitations. We also hold that because Mr. Andis entered into a plea agreement that contained a valid waiver of his appellate rights and the sentence imposed was not illegal, the conditions of his supervised release may not be reviewed on appeal. As a result, his appeal is dismissed.
I. Overview
On October 16, 2000, Mr. Andis entered into a “Stipulation of Facts Relative to Sentencing,” which included a plea agreement (the “Agreement”). In the Agreement, he pled guilty to one count of transporting a minor in interstate commerce for illegal sexual activity in violation of 18 U.S.C. § 2428(a). In exchange for the Government’s dismissal of the remaining counts in the indictment and promise not to further prosecute him for events related to transporting a fourteen-year-old girl for the purpose of engaging in sexual conduct, Mr. Andis agreed to waive certain statutory and constitutional rights, including most of his appellate rights. The relevant portions of the Agreement provided that:
In the event the District Court accepts the plea agreement ... defendant understands that as part of this agreement, both the defendant and the Government hereby mutually agree to waive all rights to appeal whatever sentence is imposed, including any issues that relate to the establishment of the Guideline range, reserving only the right to appeal from an upward or downward departure from the Guideline range that is established at sentencing. In this regard, the parties expressly acknowledge that no agreement has been reached as to issues pertinent to the Guidelines calculation, except as found in this section of the Stipulation. These issues are left for the District Court’s determination; the District Court’s decision shall not be subject to appeal. The defendant states that he is fully satisfied with the representation he has received from his counsel, that they have discussed the Government’s case, possible defenses and defense witnesses, and that his counsel has completely and satisfactorily explored all areas which the defendant has requested relative to the Government’s case and his defense, and in light of this, the defendant further agrees to waive all rights to contest the conviction or sentence, except for grounds of prosecutorial misconduct or ineffective assistance of counsel, in any post-conviction proceeding, including one pursuant to Title 28, U.S.C., Section 2255.
On appeal, Mr. Andis claims that despite waiving his appellate rights, he implicitly retained the right to appeal an illegal sentence. In particular, he argues that the conditions of his supervised release are illegal because they are generic conditions imposed without regard to the specific characteristics of his crime as required by 18 U.S.C. § 3583(d). The Government contends that Mr. Andis waived his right to appeal his sentence regardless of whether the conditions imposed render it illegal. Alternatively, the Government argues that if Mr. Andis retained the right to appeal *889an illegal sentence, then the conditions of bis supervised release do not constitute such an illegal sentence.
II. Waiver of Appellate Rights in Plea Agreements
Before analyzing the specifics of Mr. Andis’s appeal, we take this opportunity to review and clarify this Circuit’s position on the use of appeal waivers in plea agreements.
As a general rule, a defendant is allowed to waive appellate rights. Every circuit that has considered this issue has reached the conclusion that at least some forms of appeal waivers are permissible. See generally United States v. Teeter, 257 F.3d 14, 21-27 (1st Cir.2001); United States v. Hernandez, 242 F.3d 110, 113-14 (2d Cir.2001); United States v. Khattak, 273 F.3d 557, 559-63 (3d Cir.2001); United States v. Brown, 232 F.3d 399, 402-06 (4th Cir.2000); United States v. Melancon, 972 F.2d 566, 567 (5th Cir.1992); United States v. Fleming, 239 F.3d 761, 764 (6th Cir.2001); United States v. Jemison, 237 F.3d 911, 916-18 (7th Cir.2001); United States v. Nguyen, 235 F.3d 1179, 1182-84 (9th Cir.2000); United States v. Rubio, 231 F.3d 709, 711-13 (10th Cir.2000); United States v. Howie, 166 F.3d 1166, 1168-69 (11th Cir.1999). On numerous occasions, we have also acknowledged the general permissibility of including these waivers in plea agreements. See, e.g., DeRoo v. United States, 223 F.3d 919, 923-24 (8th Cir.2000); United States v. Morrison, 171 F.3d 567, 568 (8th Cir.1999); United States v. Michelsen, 141 F.3d 867, 868-73 (8th Cir.1998).
The policy reasons supporting an appeal waiver were summarized in United States v. Rutan:
[t]he chief virtues of plea agreements are speed, economy, and finality. Waivers of appeal in plea agreements preserve the finality of judgments and sentences imposed pursuant to valid pleas of guilty. We also note that plea agreements are of value to the accused in order to gain concessions from the government.
956 F.2d 827, 829 (8th Cir.1992) (internal citations omitted).
We further note that the right to appeal is not a constitutional right but rather “purely a creature of statute.” Abney v. United States, 431 U.S. 651, 656, 97 S.Ct. 2034, 52 L.Ed.2d 651 (1977); see 18 U.S.C. § 3742. The Supreme Court has held that a defendant can waive certain constitutional rights by entering a guilty plea. For example, in Parke v. Raley, 506 U.S. 20, 113 S.Ct. 517, 121 L.Ed.2d 391 (1992), the Supreme Court stated that “a guilty plea constitutes a waiver of three constitutional rights: the right to a jury trial, the right to confront one’s accusers, and the privilege against self-incrimination.” Id. at 29, 113 S.Ct. 517; see also United States v. Gray, 152 F.3d 816, 819-20 (8th Cir.1998) (discussing the constitutional rights a defendant waives by entering a guilty plea and citing to Parke). Given that the Supreme Court has allowed a defendant to waive constitutional rights, we would be hard-pressed to find a reason to prohibit a defendant from waiving a purely statutory right. Other circuits have adopted a similar rationale for approving the use of these waivers. See, e.g., Teeter, 257 F.3d at 21-22; Khattak, 273 F.3d at 561; United States v. Navarro-Botello, 912 F.2d 318, 321 (9th Cir.1990).
We see no rational basis for challenging the general premise that a defendant can enter into a plea agreement that waives appellate rights. We have, however, imposed limits on the use of these waivers and we reaffirm these limits here. When reviewing a purported waiver, we must confirm that the appeal falls within the *890scope of the waiver and that both the waiver and plea agreement were entered into knowingly and voluntarily. Even when these conditions are met, however, we will not enforce a waiver where to do so would result in a miscarriage of justice.
A. Scope of Waiver
Plea agreements are essentially contracts between the defendant and Government. Margalli-Olvera v. INS, 43 F.3d 345, 351 (8th Cir.1994). However, these agreements are subject to special limitations given their unique nature. Significantly, this Court stated in Margalli-Olvera that “[a]pplication of these contract principles is tempered by the constitutional implications of a plea agreement.” Id. Also important was our statement that “[w]here a plea agreement is ambiguous, the ambiguities are construed against the government.” Id. at 353. Interpreting plea agreements in this manner reflects the fact that these agreements are normally drafted by the Government and involve significant rights of a defendant. As such, the burden of proof is on the Government to demonstrate that a plea agreement clearly and unambiguously waives a defendant’s right to appeal. Id.
In United States v. Hernandez, the Second Circuit stated that while waivers of appellate rights are generally valid, these waivers “are to be applied ‘narrowly’ and construed ‘strictly against the Government.’ ” 242 F.3d 110, 113 (2001) (internal citation and quotations omitted). The court then concluded that the waiver in Hernandez did not prohibit the defendant from challenging the district court’s refusal to allow him to withdraw a guilty plea. Id. at 114. We agree with the position taken by the Second Circuit. Plea agreements will be strictly construed and any ambiguities in these agreements will be read against the Government and in favor of a defendant’s appellate rights.
B. Knowing and Voluntary
A defendant must enter into a plea agreement and waiver knowingly and voluntarily for these agreements to be valid. See DeRoo, 223 F.3d at 923; Morrison, 171 F.3d at 568; Michelsen, 141 F.3d at 871. This is the same standard the Supreme Court has required for all guilty pleas. See United States v. Gray, 152 F.3d 816, 819 (8th Cir.1998) (citing Parke v. Raley, 506 U.S. at 28, 113 S.Ct. 517).
The requirement that a plea agreement and waiver be entered into knowingly and voluntarily applies to each term of an agreement. For example, a defendant may knowingly and voluntarily enter into a plea agreement waiving the right to a jury trial, but nonetheless fail to have knowingly and voluntarily waived other rights-including appellate rights. There are many ways in which an agreement, or aspects of an agreement, could be entered into without the requisite knowledge or voluntariness. Examples include an agreement entered into upon the ineffective assistance of counsel, DeRoo, 223 F.3d at 924, or undue coercion.4
One important way a district court can help ensure that a plea agreement and corresponding waiver are entered into *891knowingly and voluntarily is to properly question a defendant about his or her decision to enter that agreement and waive the right to appeal. We have yet to address the impact of an erroneous statement by a district court at the time a plea agreement is accepted and decline to do so here.5 However, because an erroneous statement, or failure to make a determination as required under Fed.R.Crim.P. 11(b)(1)(N), can create potential error, a district court should endeavor to correctly address any waiver in a plea agreement and ascertain that a defendant has knowingly and voluntarily waived the rights addressed by the agreement.
Following this process should also help a district judge determine whether to accept a plea agreement. In general, a district judge is under no obligation to accept a plea agreement. See Fed.R.Crim.P. 11(c) (stating that the district court has the authority to reject most plea agreements). The authority to reject a plea agreement, if it is inequitable or otherwise objectionable, operates as a further check on either party’s over-reaching.
C. Miscarriage of Justice
Assuming that a waiver has been entered into knowingly and voluntarily, we will still refuse to enforce an otherwise valid waiver if to do so would result in a miscarriage of justice. Although we have not previously defined this exception, we have described many of its components. See DeRoo, 223 F.3d at 923-24 (stating that a waiver of appellate rights does not prohibit the appeal of an illegal sentence or a sentence in violation of the terms of an agreement, or a claim asserting ineffective assistance of counsel); Michelsen, 141 F.3d at 872 n. 3 (describing the right to appeal an illegal sentence).
Other circuits have adopted the miscarriage of justice exception and included within this exception, inter alia, sentences based on constitutionally impermissible factors (e.g., race) and claims asserting ineffective assistance of counsel. See, e.g., Teeter, 257 F.3d at 25 n. 9 & 10 (stating that the court would address, inter aha, sentences based on constitutionally impermissible factors, even when a valid waiver existed); Khattak, 273 F.3d at 562 (discussing circumstances where other circuits have found appeal waivers to be invalid).
Although we have not provided an exhaustive list of the circumstances that might constitute a miscarriage of justice, we recognize that these waivers are contractual agreements between a defendant and the Government and should not be easily voided by the courts. As such, we caution that this exception is a narrow one and will not be allowed to swallow the general rule that waivers of appellate rights are valid.
As the miscarriage of justice exception relates to Mr. Andis’s appeal, we reaffirm that in this Circuit a defendant has the right to appeal an illegal sentence, *892even though there exists an otherwise valid waiver. See DeRoo, 223 F.3d at 923; Michelsen, 141 F.3d at 872.6 In United States v. Greatwalker, we explained that “[a] sentence is illegal when it is not authorized by the judgment of conviction or when it is greater or less than the permissible statutory penalty for the crime.” 285 F.3d 727, 729 (8th Cir.2002). In United States v. Peltier, we recently addressed what constitutes an illegal sentence:
[а] sentence is illegal when it is not authorized by law; for example, when the sentence is “in excess of a statutory provision or otherwise contrary to the applicable statute.” A sentence is not illegal if the “punishment meted out was not in excess of that prescribed by the relevant statutes ... or the terms of the sentence itself are not legally or constitutionally invalid in any other respect.”
312 F.3d 938, 942 (8th Cir.2002) (internal citations omitted).
We wish to make clear that the illegal sentence exception to the general enforceability of an appeal waiver is an extremely narrow exception. Any sentence imposed within the statutory range is not subject to appeal. Specifically, an allegation that the sentencing judge misapplied the Sentencing Guidelines or abused his or her discretion is not subject to appeal in the face of a valid appeal waiver. Other circuits have explicitly addressed these situations. See, e.g., United States v. Brown, 232 F.3d 399, 403 (4th Cir.2000) (“an express waiver of [a defendant’s] right to appeal, which was knowing and voluntary, [precludes] an appeal based on [a] claim that [a] district court misapplied the Guidelines.”); United States v. Atterberry, 144 F.3d 1299, 1300 (10th Cir.1998) (dismissing the defendant’s appeal of the base offense level used by the district court in determining his sentence, because he had waived his appellate rights); United States v. Feichtinger, 105 F.3d 1188, 1190 (7th Cir.1997) (“an improper application of the guidelines is not a reason to invalidate a knowing and voluntary waiver of appeal rights.”).
III. Mr. Andis’s Appeal
Having reviewed this Circuit’s approach to the waiver of appellate rights, we now examine Mr. Andis’s argument that in spite of his waiver we should allow him to appeal the conditions of his supervised release. We find that the challenged conditions do not constitute an illegal sentence and, as such, dismiss his appeal.
It is undisputed that the scope of Mr. Andis’s waiver includes the conditions of his supervised release,7 and he does not claim that the waiver was entered into unknowingly or involuntarily. There is also no allegation that the district court failed to comply with Federal Rule of Criminal Procedure 11 in accepting Mr. Andis’s guilty plea. Accordingly, we may consider Mr. Andis’s appeal only if our *893failure to do so would constitute a miscarriage of justice.
Mr. Andis attempts to make this showing by arguing that the conditions of his supervised release constitute an illegal sentence. Specifically, he claims that the district court imposed five illegal conditions on his supervised release:
(1) prohibition from contact with children under the age of 18 without prior written permission of the probation officer and immediate reports ing to the probation officer of any unauthorized contact with children under the age of 18;
(2) prohibition on engaging in any occupation, business or profession where he has access to children under the age of 18 without prior written approval of the probation officer;
(3) prohibition on loitering within 100 feet of schools, parks, playgrounds, arcades or other places frequented by children;
(4) submission to search of his person, residence, office, or vehicle by a probation officer based upon reasonable suspicion of contraband or evidence of a violation of conditions of release; and
(5) prohibition on the purchase or maintenance of a post office box or other type of private mailbox without written approval of the probation officer.
Were this appeal to address the length of Mr. Andis’s imprisonment, we would simply need to review the length of time authorized by statute to determine whether his sentence was legal and his appeal should be summarily dismissed based on his waiver. Mr. Andis, however, is appealing the conditions of his supervised release. The statutory provision states:
The court may order, as a further condition of supervised release, to the extent such condition-
(1) is reasonably related to the factors set forth in section 3553(a)(1), (a)(2)(B), (a)(2)(C), and (a)(2)(D);
(2) involves no greater deprivation of liberty than is reasonably necessary for the purposes set forth in section 3553(a)(2)(B), (a)(2)(C), and (a)(2)(D); and
(3) is consistent with any pertinent policy statements issued by the Sentencing Commission pursuant to 28 U.S.C. 994(a);
any condition set forth as a discretionary condition of probation in section 3563(b)(1) through (b)(10) and (b)(12) through (b)(20), and any other condition it considers to be appropriate.
18 U.S.C. § 3583(d).
This statutory provision provides the district court with broad discretion to impose conditions the court considers to be appropriate in setting a term of supervised release. United States v. Bass, 121 F.3d 1218, 1223 (8th Cir.1997). If an appeal waiver did not exist, this Court would examine the conditions of Mr. Andis’s supervised release under an abuse of discretion standard. See United States v. Scott, 270 F.3d 632, 635 (8th Cir.2001) (describing the standard used to determine if a district court abused its discretion in imposing the conditions of supervised release); United States v. Kent, 209 F.3d 1073, 1075-78 (8th Cir.2000) (finding that the district court abused its discretion); Bass, 121 F.3d at 1223 (same); United States v. Prendergast, 979 F.2d 1289, 1293 (8th Cir.1992) (same). However, in this case, Mr. Andis’s appeal waiver prevents this Court from reviewing the conditions of his supervised release and determining whether the dis*894trict court abused its discretion in imposing those conditions.
This result is consistent with a recent case from the Seventh Circuit, United States v. Sines, 303 F.3d 793 (7th Cir.2002), where that court addressed an almost identical issue. Like Mr. Andis’s Agreement, Mr. Sines’s plea agreement contained an appeal waiver. Mr. Sines pled guilty to bank fraud, but because of a prior conviction for sexual exploitation of a minor, the district court also imposed conditions of supervised release that included attendance at a sex-offender treatment program and periodic polygraph testing. The defendant appealed, claiming that he had already completed an intensive sex-offender treatment program and that he had not engaged in any illegal contact with a minor in over ten years. Therefore, he argued, the conditions of his supervised release were not reasonably related to his rehabilitation or to the protection of the public. The Seventh Circuit refused to consider Mr. Sines’s arguments and held that the appeal waiver in the plea agreement made the conditions of his supervised release unreviewable.
Where a defendant, like Mr. Andis, does not claim that he failed to enter into an appeal waiver knowingly and voluntarily, or that the supervised release conditions constituted a miscarriage of justice because they were based on some constitutionally impermissible factor, such as race, the conditions are not subject to review on appeal. Accordingly, Mr. Andis’s appeal is dismissed.
. Although Mr. Andis’s plea agreement waived both his appellate rights and his post-conviction rights under 28 U.S.C. § 2255, this appeal concerns only a defendant's waiver of appellate rights. We note, however, that we have often viewed these two rights as synonymous. See, e.g., DeRoo v. United States, 223 F.3d 919, 923 (8th Cir.2000) ("As a general rule, we see no reason to distinguish the enforceability of a waiver of direct-appeal rights from a waiver of collateral-attack rights in the plea agreement context.”)
. The Honorable Stephen N. Limbaugh, United States District Judge for the Eastern District of Missouri.
. Although we have not yet decided a case alleging such coercion, the First Circuit has allowed a defendant to challenge a facially valid waiver because it was entered into as a result of undue coercion from the court. Worcester v. Commissioner, 370 F.2d 713 (1st Cir.1966); but see Teeter, 257 F.3d at 21 n. 3 (explaining that "the court [in Worcester] had pressured the taxpayer-defendant into waiving his right to appeal in exchange for a lighter sentence” and the agreement was not one "between the prosecution and the defense.”) (emphasis in original).
. We note that this Court in Michelsen addressed erroneous statements made by the court at a defendant's sentencing hearing and determined that the district court’s erroneous statements did not negate a waiver of appellate rights. 141 F.3d at 872. This position has been adopted by other circuits. See United States v. Fisher, 232 F.3d 301, 304-05 (2d Cir.2000) (stating that the Second Circuit joins the Fifth, Sixth, Eighth, and Tenth in determining that an erroneous statement made post-sentencing did not negate the waiver of appellate rights, but noting, however, that such a statement could result in a finding that the plea agreement was ambiguous).
What has not been addressed by this Circuit is the impact an erroneous statement, about a defendant's appellate rights, will have on the validity of a waiver if that statement is made when a plea agreement is accepted by the district court.
. We wish to emphasize that a defendant has the right to challenge an illegal sentence on direct appeal and does not have to rely solely on his post-conviction remedies. To the extent this holding conflicts with our opinion in Rutan, where we stated that "an illegal sentence can still be challenged under 28 U.S.C. § 2255 for habeas corpus relief, so a defendant is not entirely without recourse from an erroneous sentence,” 956 F.2d at 829-30, that narrow portion of Rutan is overruled.
. In the Agreement Mr. Andis acknowledged that he "waive[d] all rights to appeal whatever sentence is imposed.” Because the court sentenced Mr. Andis to eighteen months of incarceration, the court was "required to impose a term of supervised release to follow imprisonment.” U.S.S.G. § 5D1.1, app. n. 1. Therefore, Mr. Andis’s waiver included that portion of his sentence which involved the imposition of a term of supervised release and its conditions.