
528 F.3d 1099 (2008)
UNITED STATES of America, Appellee,
v.
Darrill GRAY, Appellant.
No. 07-3256.
United States Court of Appeals, Eighth Circuit.
Submitted: April 14, 2008.
Filed: June 19, 2008.
William S. Margulis, St. Louis, MO, for appellant.
Howard J. Marcus, AUSA, St. Louis, MO, for appellee.
Before WOLLMAN, BEAM, and RILEY, Circuit Judges.
RILEY, Circuit Judge.
Darrill Gray (Gray) pled guilty to one count of conspiracy to commit sex trafficking of a minor, in violation of 18 U.S.C. *1100 § 371. Gray's plea was the product of a plea agreement under which two other charges brought against Gray in a four count indictment[1] were droppedCount II, sex trafficking of a child, in violation of 18 U.S.C. § 1591, and Count IV, distributing cocaine base, in violation of 21 U.S.C. § 841. As a part of the plea agreement, Gray agreed:
the defendant fully understands that there will be no right to withdraw the plea entered under this agreement, except where the Court rejects those portions of the plea agreement which deal with charges the government agrees to dismiss. . . . [and]
. . .
[to] waive all rights to appeal all non-jurisdictional issues including, but not limited to, any issues relating to pre-trial motions, hearings and discovery and any issues relating to the negotiation, taking or acceptance of the guilty plea or the factual basis for the plea.. . . all rights to appeal all sentencing issues . . . . [and] all rights to contest the conviction or sentence in any post-conviction proceeding, including one pursuant to Title 28, United States Code, Section 2255, except for claims of prosecutorial misconduct or ineffective assistance of counsel.
(emphasis added). The district court[2] sentenced Gray to 60 months imprisonment. On appeal, Gray contends the district court abused its discretion in denying Gray's amended motion to withdraw his guilty plea.

I. BACKGROUND
Gray's proposed plea agreement was sent to his attorney, Steven V. Stenger (Stenger), who explained the agreement to Gray. On April 26, 2007, at a change of plea hearing, Gray entered his guilty plea to Count I and the government agreed to dismiss the remaining counts of the indictment at sentencing. At this hearing, the court advised Gray he was under oath and Gray indicated he understood. The court asked Gray if he had reviewed the indictment or the charges against him and Gray acknowledged he had, expressing no questions. Gray also acknowledged (1) he had an opportunity to review the guilty plea with his attorney, (2) he understood the guilty plea, (3) he agreed with everything in the guilty plea and the accompanying stipulation, and (4) no one forced or coerced him into pleading guilty. The court also clarified Gray understood he was pleading guilty to a felony charge which may result in Gray's loss of, "certain civil rights . . . such as the right to vote. . . to hold public office . . . to serve on a jury . . . [and] to possess any kind of a firearm." The court next reviewed the maximum possible penalties. Gray said he understood the potential penalties he faced for being adjudged guilty of the crime and the attendant advisory Sentencing Guidelines which might apply.
The court also reviewed the waivers which were part of the plea agreement, clarifying (1) Gray understood and agreed he was waiving his "right to appeal all nonjurisdictional issues . . . [or] to appeal all sentencing issues" if sentenced "within the Guideline range," and (2) Gray had discussed these waivers with his attorney. Finally, the court questioned Gray to be sure (1) Gray understood he was waiving his "right to challenge the conviction or the sentence in a subsequent proceeding unless" he was challenging the conviction "on the grounds of the prosecutor's misconduct or ineffective assistance of counsel," *1101 and (2) Gray had "discussed that waiver with Mr. Stenger," was "in agreement with" the waiver, and did not "have any questions about [the waiver]." Gray replied he understood and agreed with the waiver and had no questions about the waiver. Only after this and other extensive dialogue with Gray did the court accept Gray's plea of guilty to Count I.
Four days later, in a letter dated April 30, 2007, and transmitted by facsimile on May 2, 2007, Gray notified Stenger he wanted to withdraw his guilty plea. Gray reiterated his desire to withdraw his plea in additional letters dated May 1, May 2, and May 4, 2007. In a letter dated May 2, 2007, received by the court on May 7, 2007, Gray asked to withdraw his plea and to have Stenger withdrawn as his attorney. On May 16, 2007, Gray filed a pro se motion seeking appointment of new counsel. On May 25, 2007, the court appointed new counsel for Gray and, on July 23, 2007, Gray's newly appointed counsel filed an amended motion to withdraw Gray's guilty plea.
On August 17, 2007, an evidentiary hearing was held on Gray's motion to withdraw his plea. At this hearing, Gray's testimony contradicted his statements made at the April 26, change of plea hearing. Gray now testified (1) he did not understand the charges against him; (2) he did not understand what charge he was pleading guilty to; (3) he was not shown the plea agreement until he was in court on April 26, 2007, before the change of plea hearing; (4) he never had an opportunity to review the plea agreement in its entirety or to discuss it with his attorney before the hearing; and (5) he felt coerced by his attorney to enter into the guilty plea.
Stenger's testimony at the evidentiary hearing contradicted Gray's testimony. Stenger testified he was appointed to represent Gray; before Gray's arraignment, on April 2, 2007, Gray received a copy of the indictment which Stenger reviewed with Gray; and after the arraignment Stenger fully explained the charges "many times" to Gray. On April 10, 2007, Stenger traveled to the Crawford County, Missouri jail to meet with Gray and to discuss Gray's options, including a plea or a trial. Stenger followed up this discussion with an April 12, 2007 letter to Gray explaining everything in detail. On April 17, 2007, Gray sent two letters via facsimile to Stenger. The first letter asked Stenger to "[m]ove forward with a pre-trial resolution ASAP meaning: Plea Agreement." The second letter stated, "I want to cooperate. No trial." On April 19, 2007, Gray sent another letter via facsimile to Stenger asking Stenger to, "[l]et me know as soon as possible what's the lowest plea bargain I can get."
Stenger testified he negotiated a plea agreement with the government based on Gray's correspondence. Stenger also testified he met with Gray on April 23, 2007, before a scheduled proffer interview, for 45 minutes to an hour, and reviewed the important provisions of the plea agreement, "particularly, the appellate waiver." Stenger testified that, on the date of the change of plea hearing, Stenger went over the plea agreement with Gray, spending approximately an hour and a half reviewing the plea agreement with Gray before the hearing, and "both reading the Plea Agreement to him and answering any questions he had regarding the Plea Agreement and paraphrasing every paragraph." Stenger opined, "I was very careful with respect to the Plea Agreement."
Stenger testified Gray indicated he understood the contents of the plea agreement. Stenger noted Gray, "had particular questions regarding the maximum for this count that we're talking about, Count I, that it was a five-year count, that it limited his exposure. . . ." Stenger testified (1) it was his belief Gray "absolutely" knew *1102 what he was doing when he executed the plea agreement, and (2) Gray told Stenger this is what he wanted to do.

II. DISCUSSION
"We review the district court's denial of the motion to withdraw [the guilty plea] for an abuse of discretion." United States v. Ramirez-Hernandez, 449 F.3d 824, 826 (8th Cir.2006) (citation omitted). "A district court may permit a defendant to withdraw a guilty plea before sentencing if there is a fair and just reason for the withdrawal. While the standard [for allowing withdrawal] is liberal, the defendant has no automatic right to withdraw a plea." Id. (citations omitted).
"As a general rule, a defendant is allowed to waive appellate rights." United States v. Andis, 333 F.3d 886, 889 (8th Cir.2003) (en banc). "When we review a[n] [appeal] waiver, we must make two determinations: that the issue falls within the scope of the waiver and that both the plea agreement and the waiver were entered into knowingly and voluntarily." United States v. McIntosh, 492 F.3d 956, 959 (8th Cir.2007) (citing United States v. Aronja-Inda, 422 F.3d 734, 737 (8th Cir. 2005) (quoting Andis, 333 F.3d at 889-90)). "Even if both of these determinations are decided in the affirmative, we will not enforce a plea agreement waiver if enforcement would cause a miscarriage of justice." Id. The government bears the burden of establishing "(1) that the appeal is clearly and unambiguously within the scope of the waiver, (2) that the defendant entered into the waiver knowingly and voluntarily, and (3) that dismissing the appeal based on the defendant's waiver would not result in a miscarriage of justice." Id. (quoting Aronja-Inda, 422 F.3d at 737 (citing Andis, 333 F.3d at 889-90)) (internal brackets omitted).
Gray expressly, clearly and voluntarily waived his appellate rights related to the taking and acceptance of his plea. The waiver itself was unambiguous, and Gray's counsel, Stenger, and the district court accurately and thoroughly explained the plea agreement and appeal waiver to Gray. Gray's testimony at the change of plea hearing strongly supported the district court's finding Gray entered into the waiver knowingly and voluntarily. Moreover, the plea agreement was supported by consideration, given the government's agreement to drop two other charges, including Count II which had a mandatory minimum sentence of ten years. See United States v. Sanchez, 508 F.3d 456, 460 (8th Cir. 2007) ("Plea agreements are contractual in nature and should be interpreted according to general contract principles." (citation omitted)). No miscarriage of justice exists. Thus, Gray may not challenge the denial of his motion to withdraw his guilty plea on appeal because Gray knowingly and voluntarily waived his right to appeal any issues relating to the negotiation, taking or acceptance of his guilty plea or the factual basis for the plea.

III. CONCLUSION
We affirm.
NOTES
[1]  Gray was not named in Count III of the indictment.
[2]  The Honorable Jean C. Hamilton, United States District Judge for the Eastern District of Missouri.
