dissenting in part and concurring in the judgment.
John R. Andis pleaded guilty to transporting a minor in interstate commerce for illegal sexual activity in violation of 18 U.S.C. § 2423(a), after agreeing with the government “to waive all rights to appeal whatever sentence is imposed ... reserving only the right to appeal from an upward or downward departure.” At the time that he pleaded guilty and at his sentencing hearing, Mr. Andis acknowledged the existence of this promise in his plea agreement. He now appeals from the conditions of supervised release that the district court imposed on him at sentencing, asserting that they were illegal because they bear no reasonable relationship to his offense. Despite Mr. Andis’s clear and unambiguous promise not to appeal his sentence, the court now entertains his appeal. I respectfully dissent.
We have held repeatedly that a defendant in a criminal case may waive his right to appeal if he does so knowingly and voluntarily. See, e.g., United States v. Estrada-Bahena, 201 F.3d 1070, 1071 (8th Cir.2000) (per curiam)-, United States v. Greger, 98 F.3d 1080, 1081-82 (8th Cir.1996). There is no evidence that Mr. An-dis’s consent to the plea agreement in this case was not knowing or voluntary, and, indeed, he does not contend that it was not. He maintains, instead, that a defendant cannot waive the right to appeal an *988illegal sentence, and cites two cases of ours in support of this contention.
In United States v. Michelsen, 141 F.3d 867, 869 (8th Cir.1998), cert. denied, 525 U.S. 942, 119 S.Ct. 363, 142 L.Ed.2d 299 (1998), we had under consideration a plea agreement that “waive[d] any right to raise and/or appeal ... concerning any and all ... defenses ... which defendant ... could assert ... to the ... imposition of sentence.” In the course of our discussion, we noted that such a waiver would not “prevent a challenge under 28 U.S.C. § 2255 to an ‘illegal sentence,’ such as a sentence imposed in excess of the maximum penalty provided by statute or based upon a constitutionally impermissible factor such as race.” Id. at 872 n. 3. Presumably, this statement of principle was simply an acknowledgment that a promise not to appeal does not, as a matter of law, imply a promise not to engage in a collateral attack. We are nob concerned here with a collateral attack, so the statement has no application, though I note that the plea agreement in the instant case also contains a waiver of “all rights to contest the ... sentence ... except for grounds of prosecutorial misconduct or ineffective assistance of counsel ... in any post-conviction proceeding [under] 28 U.S.C., Section 2255.”
It is true that we also stated in Michelsen, 141 F.3d at 872, that the defendant in that case had “implicitly preserved his right to appeal on grounds that his sentence was illegal.” In the first place, however, the statement is dictum because there was no claim in Michelsen that the sentence was illegal. In the second place, the agreement in Michelsen differed in an important way from the one under consideration here. The agreement here, as I have already noted, contains some explicit exceptions, and I think that the specific reservation of rights with respect to those negates the existence of any supposed general implicit exception for an illegal sentence, especially when the exceptions themselves deal with sentences contrary to law.
The other case to which Mr. Andis calls our attention is DeRoo v. United States, 223 F.3d 919, 923 (8th Cir.2000), which relies on Michelsen for the proposition that “defendants cannot waive their right to appeal an illegal sentence.” But this is not what Michelsen said: As I have already explained, Michelsen said that the defendant in that case did not as a matter of fact waive his right to appeal an illegal sentence, not that he could not as a matter of law. The statement in DeRoo is, in any case, dictum, because the defendant’s argument there was that his waiver was not knowing and voluntary, see 223 F.3d at 923, not that his sentence was illegal.
In short, I see no obstacle to the enforcement of Mr. Andis’s waiver of his right to appeal. I agree with the Fifth Circuit that “[w]hen a defendant waives her right to appeal, she gives up the very valuable right to correct a district court’s unknown and unannounced sentence. After waiving her right to appeal, the district court could err in its application of the Sentencing Guidelines or otherwise impose an illegal sentence.” United States v. Baty, 980 F.2d 977, 979 (5th Cir.1993), cert. denied, 508 U.S. 956, 113 S.Ct. 2457, 124 L.Ed.2d 672 (1993). As we have previously observed, plea agreements involve the exchange of sentencing concessions by the government for “an assurance that it would not be required to expend valuable time and resources” on appeal, Michelsen, 141 F.3d at 873. By allowing this appeal to proceed, the court “eliminate^] one of the primary incentives the government has for negotiating plea agreements,” id.
I nevertheless agree with Judge Bright, and for the reasons that he states, that the *989conditions imposed on Mr. Andis may well have been unreasonable and thus unauthorized by law. I therefore concur in the judgment of remand, even though I believe that this appeal is quite plainly barred by Mr. Andis’s promise, because otherwise the court could not issue a mandate.