
539 F.3d 589 (2008)
UNITED STATES of America, Plaintiff-Appellant,
v.
Jerry L. VINYARD, Defendant-Appellee.
In the Matter of The United States of America, Petitioner.
Nos. 07-2304, 07-2674.
United States Court of Appeals, Seventh Circuit.
Argued February 15, 2008.
Decided August 20, 2008.
*590 Thomas Edward Leggans (argued), Office of the United States Attorney, Benton, IL, for Plaintiff-Appellant.
Gene Gross (argued), Reed, Heller, Mansfield & Gross, Duquoin, IL, Susan Gentle, St. Louis, MO, for Defendant-Appellee.
Before FLAUM, WOOD, and EVANS, Circuit Judges.
WOOD, Circuit Judge.
Unsure of the proper procedural vehicle to use, the Government has brought this case before us using two alternatives: an interlocutory appeal (No. 07-2304) and a petition for a writ of mandamus (No. 07-2674). We conclude that appellate jurisdiction under 18 U.S.C. § 3731 is problematic, since the district court did not issue any of the orders described by that statute. We conclude, however, that this is one of those rare cases in which a writ of mandamus should issue. We therefore reserve for another day the question whether we might have been able to accept this type of case as an ordinary interlocutory appeal.

I
Jerry Vinyard entered an "open plea" to charges of manufacturing, distributing, and possessing with intent to distribute methamphetamine. See 18 U.S.C. §§ 841(a)(1) and 846. He stipulated that he had a prior felony drug conviction (from 1984) and also that the conspiracy this time around involved more than 500 gramsa fact that increased his mandatory minimum sentence to 240 months.
At sentencing on May 3, 2007, no one had any objections to the presentence report (PSR), which recommended a guideline range of 235-293 months' imprisonment, based on a finding that Vinyard was involved with 36.5 kilograms of methamphetamine and had possessed a firearm during the offense. Before imposing the sentence, the district court agreed to allow Vinyard's wife to address the court. She spoke for some time, emphasizing the effect that a long sentence would have on their 11-year-old daughter. After his wife spoke, Vinyard for the first time questioned some of the facts in the PSR having to do with amounts of anhydrous ammonia involved in the crime. The district court asked him if he was objecting to the PSR. Vinyard waffled, seeming to say yes, but noting that he was not acting on the advice of counsel, who was concerned about Vinyard's jeopardizing his three-level reduction for acceptance of responsibility and other benefits he was expecting. After a brief recess, Vinyard withdrew any objections, and the district court sentenced him to the mandatory minimum of 240 months.
At this point, the district court appears to have had second thoughts. The next day, May 4, without giving any notice to the Government, he ordered Vinyard's release. This caused problems because the order was not filed until May 7; the Government learned of Vinyard's release only when an agent happened to see him walking into the Probation Office. The Government immediately filed a notice of appeal of the release order on May 7 (No. 07-2058), and on May 10 it filed a motion to reverse and vacate the release order. That same day (May 10), this court entered an order requiring Vinyard to be detained. The district court responded *591 hours later by sua sponte vacating Vinyard's plea and sentence, ordering new appointed counsel, vacating its release order, and ordering Vinyard to self-report the next day. This court issued another order reiterating the immediate detention order. The Government filed an appeal of the May 10 order vacating the plea and sentence (No. 07-2304). The appeal of the release order was dismissed on the ground that it had become moot.
Along with its appeal of the vacatur, the Government filed a motion to stay the proceedings with both the district court and the circuit on June 5. On June 13, one day before the next scheduled status hearing, the district court granted the motion to stay and amplified on its reasons for vacating the plea and sentence. On July 17, the Government filed a petition for a writ of mandamus to compel the district court to reinstate the sentence it had pronounced (No. 07-2674).
On August 6, this court ordered briefing on the question whether the direct appeal "should proceed only in the related Petition for Mandamus relief" under United States v. Spilotro, 884 F.2d 1003 (7th Cir. 1989). On November 5, the direct appeal and the mandamus petition were consolidated for oral argument and disposition.

II
Mandamus is an extraordinary remedy, "issued only in extraordinary cases." In re Rhone-Poulenc Rorer, Inc., 51 F.3d 1293, 1294 (7th Cir.1995). There are two conditions for issuing a writ of mandamus:
The first is that the challenged order not be effectively reviewable at the end of the casein other words, that it inflict irreparable harm.... The petitioner must ordinarily demonstrate that something about the order, or its circumstances, would make an end-of-case appeal ineffectual or leave legitimate interests unduly at risk.... Second, the order must so far exceed the proper bounds of judicial discretion as to be legitimately considered usurpative in character, or in violation of a clear and indisputable legal right, or, at the very least, patently erroneous.
Id. at 1295 (quotations and citations omitted). In addition, we normally will reject a petition for a writ of mandamus if the requesting party has an adequate remedy at law. We believe that all of these conditions are satisfied in this case.

A. Adequacy of Legal Remedy
There is no need to issue a writ of mandamus if the normal procedures for error correction would suffice. Thus, if, as the Government argues in No. 07-2304, this court has clear appellate jurisdiction over the district court's order of May 10, it would be inappropriate to resort to mandamus. The statute governing appellate jurisdiction in criminal cases is 18 U.S.C. § 3731. To support jurisdiction in this appeal, the Government relies on paragraph 1 of the statute, which says:
In a criminal case an appeal by the United States shall lie to a court of appeals from a decision, judgment, or order of a district court dismissing an indictment or information or granting a new trial after verdict or judgment, as to any one or more counts, or any part thereof, except that no appeal shall lie where the double jeopardy clause of the United States Constitution prohibits further prosecution.
The district court's order of May 10 setting aside, on its own motion, Vinyard's plea and sentence, is (the Government argues) the functional equivalent of an order "granting a new trial after verdict or judgment." Therefore, it concludes, appellate jurisdiction exists under § 3731.
*592 The Government is overlooking the critical qualification to this power that appears at the end of the paragraph quoted above: no appeal is permitted if there would be a double jeopardy problem. Normally, if a district court grants a new trial after verdict or judgment, it does so upon the defendant's motion under FED.R.CRIM.P. 33. Under those circumstances, there is no double jeopardy problem if the Government appeals. If it succeeds, then the original verdict or judgment is simply reinstated; if it loses, then the defendant receives the new trial that he or she requested. Here, however, Vinyard never made a motion under Rule 33: the district court wiped the slate clean on its own.
Vinyard received due process and jeopardy attached in his first proceeding once the court pronounced its sentencepossibly even as early as when it accepted his guilty plea. See Dawson v. United States, 77 F.3d 180, 182 (7th Cir.1996). The district court effectively granted him a new trial without waiting for Vinyard to request this relief. While double jeopardy can be waived by the defendant, see Ricketts v. Adamson, 483 U.S. 1, 11, 107 S.Ct. 2680, 97 L.Ed.2d 1 (1987), a court is on much shakier ground finding the protections lost when the only action is by the prosecution or the court, Ricketts, 483 U.S. at 23-26, 107 S.Ct. 2680 (Brennan, J., dissenting). Justice Brennan cited United States v. Dinitz, 424 U.S. 600, 609, 96 S.Ct. 1075, 47 L.Ed.2d 267 (1976) (alteration in Ricketts), which says: "the important consideration, for purposes of the Double Jeopardy Clause, is that the defendant retain primary control over the course to be followed in the event of [prejudicial prosecutorial or judicial] error." Indeed, in United States v. Smith, 331 U.S. 469, 474-75, 67 S.Ct. 1330, 91 L.Ed. 1610 (1947), the Supreme Court avoided the question whether a grant of a new trial solely on the court's own initiative would violate the defendant's rights under the Double Jeopardy Clause precisely because it raised such an important and difficult constitutional question. Citing Smith, this court has echoed these misgivings: "In the absence of a proper motion by the defendant, a judge obviously cannot presume that a defendant is waiving his double jeopardy rights and is willing to be re-tried." United States v. Scop, 942 F.2d 1004, 1008 (7th Cir.1991). Vinyard would have a nonfrivolous claim that a subsequent trial would subject him to jeopardy and punishment a second time on the same indictment, which would bar his reprosecution and leave the Government no way to remedy the matter.
If this case were otherwise unsuitable for mandamus relief, we would have no choice but to decide once and for all whether the district court's actions had the effect of putting Vinyard twice in jeopardy for his offense. The district court, at a minimum, created a serious question whether § 3731 supports jurisdiction over an appeal. This is enough to support a finding that the remedy at law may be inadequate. We therefore turn to the other criteria that govern mandamus relief to see whether it is proper here.

B. Irreparable Harm
If the district court's May 4 release order and May 10 vacatur of Vinyard's plea and sentence were allowed to stand, irreparable harm of several kinds would arise. Various potential dangers were demonstrated when the United States learned of Vinyard's release only when he ambled into the Probation Office: his precipitous release might have allowed him to inflict harm on others, if he had been armed; he may have absconded; or he might have slipped away and resumed his methamphetamine dealings.
*593 Even if the Government could somehow prevail against a double jeopardy defense, there is a possibility that Vinyard might be acquitted in a second round of proceedings if he insisted on a trial and put the Government to its proof. Because of the constraints on Government appeals of criminal convictions, see 18 U.S.C. § 3731, an acquittal upon retrial would be a "harm" from the Government's perspectivea conviction it had on May 3 would have evaporated as a result of the district court's May 10 order. This is a harm for which there would be no remedy.
These risks of irreparable harm satisfy the requirements of In re Rhone-Poulenc. The first possibility demonstrates that the orders "[left] legitimate interests unduly at risk," In re Rhone-Poulenc, 51 F.3d at 1295, namely the safety of prosecutorial personnel and the public. The next two possibilities show that "the challenged order [would] not be effectively reviewable at the end of the case," id., either because a nonfrivolous double jeopardy challenge bars the prosecution from the outset or an acquittal leaves the prosecution with a loss from which it cannot appeal at all.

C. Judicial Usurpation, Violation of a Clear Right, or Patent Error
The Government argues that the district court committed two patent errors in this case: first, a violation of FED.R.CRIM.P. 35(a), which governs immediate corrections of sentences; and second, a violation of FED.R.CRIM.P. 11(e), which addresses the finality of a plea of guilty or nolo contendere.

1. Rule 35(a)
The district court relied in part on Rule 35(a), which reads as follows:
Within 7 days after sentencing, the court may correct a sentence that resulted from arithmetical, technical, or other clear error.
The district court believed that there were two clear errors requiring correction: it had failed to inquire sufficiently into prior convictions and warn the defendant about their impact (as required by 21 U.S.C. § 851(b)), and it came to believe that the defendant may not have knowingly and voluntarily agreed to the relevant conduct in the PSR. Neither of these points justifies use of Rule 35(a).
When the Government files an information under § 851,
the court shall after conviction but before pronouncement of sentence inquire of the [defendant] whether he affirms or denies that he has been previously convicted as alleged in the information, and shall inform him that any challenge to a prior conviction which is not made before sentence is imposed may not thereafter be raised to attack the sentence.
21 U.S.C. § 851(b). In any case, "[n]o person who stands convicted of an offense under this section may challenge the validity of any prior conviction alleged ... which occurred more than five years before the date of the information...." 21 U.S.C. § 851(e). Taken together, § 851(b) and (e) allow a prior conviction that might be used to enhance a sentence to be challenged during the sentencing phase; a challenge cannot be brought until the guilt phase is complete, and no challenge is possible if the conviction is over five years old. Vinyard's prior conviction was in 1984, and thus it is covered by § 851(e): he was no longer entitled to attack its validity at the time of his sentencing hearing.
The court's duty to inquire under § 851(b) arises only after conviction or the acceptance of the guilty plea. A failure to conduct that inquiry cannot retroactively draw into question the antecedent guilty *594 plea. At most, an error here might call the sentence into question. Cf. FED. R.CRIM.P. 11(b) (listing the items about which a defendant must be admonished before a guilty plea may be accepted, but not mentioning § 851 or prior convictions used for enhancement). The district court's belief here that it had not complied properly with § 851(b) cannot be grounds for applying Rule 35(a) to the guilty plea. If a violation of § 851(b) caused the court to misstate the maximum possible penalty, then there would be a violation of Rule 11(b)(1)(H), which would be subject to correction if the defendant wished to set aside his guilty plea and if he could convince the district court to allow him to withdraw the plea under Rule 11(d).
The district court's alleged § 851(b) error would not warrant relief from the sentence, either. If any potential collateral attack would be barred by § 851(e), the district court is under no duty to inquire under § 851(b), United States v. Arango-Montoya, 61 F.3d 1331, 1339 (7th Cir.1995) (per curiam), even though it is probably good practice to do so, id. Given that there is no duty, there is no error justifying the radical action of setting aside the guilty plea without any request from the defendant.
We say "alleged" error because it is not at all clear on this record that there was any error at all (or at least anything that should not be characterized as harmless). Vinyard unequivocally affirmed the fact of his earlier convictions during the sentencing proceeding, saying: "I ended up with the charge because I was guilty." Although he expressed reservations about the present charges, he had no reservations about his prior criminal record.
We also see no error in the district court's decision to adopt the findings in the PSR. Although it required a brief recess so that he could consult with his lawyer, Vinyard eventually expressly stated that he had no objection to the PSR. Any error relating to the quantity of drugs would, on this record, have been harmless. The only issue was whether the amount of methamphetamine involved in the conspiracy was greater than 500 grams. If so, the mandatory minimum sentence of 240 months would be triggered. Vinyard had already stipulated to at least this amount, and so even if there were some problem with the PSR, there was sufficient evidence from other sources that would have supported the same mandatory minimum sentencewhich is, after all, what Vinyard received in the end.
The district court committed no error that would justify invocation of its powers under Rule 35(a) to correct a "clear error," much less an error that would justify setting aside the guilty plea, which was entered before any of the alleged errors took place. Rule 35(a) provides no support for the court's action.

2. Rule 11(e)
Rule 11(e) underscores the finality to which a plea of guilty or nolo contendere is entitled. It states:
After the court imposes sentence, the defendant may not withdraw a plea of guilty or nolo contendere, and the plea may be set aside only on direct appeal or collateral attack.
The district court thought that this provided alternative support for its action. Once again, we find it to be mistaken.
To begin with, Vinyard never tried to withdraw his guilty plea; it was the court that pulled it away from him. Once sentence has been pronounced, the Rule says that it may be set aside only on direct appeal or collateral attack. See United States v. Patterson, 381 F.3d 859, 865 (9th Cir.2004) ("[A]lthough the district court is *595 free to reject the plea agreement after accepting a guilty plea, it is not free to vacate the plea either on the government's motion or sua sponte. Instead, when the court accepts a guilty plea but rejects the plea agreement, it becomes the defendant's choice whether to stand by the plea or to withdraw the plea."). Patterson illustrates that the methods followed by the district court in this case effectively usurped a choice that was the defendant's to make: how to challenge potential problems with his sentence.
The district court acted as if sentence was imposed, for Rule 11 purposes, only when a written judgment was filed, but that is incorrect. Oral pronouncement of the sentence triggers the bar. See United States v. Ogden, 102 F.3d 887, 888-89 (7th Cir.1996). The sentence was imposed on May 3, and the Rule 11 bar on setting aside the plea had attached by the June 10 order. The district court's order thus violated FED.R.CRIM.P. 11(e).

III
Although mandamus is an extraordinary writ, issuance of the writ is warranted, among other reasons, in order "to ensure the proper application of [the Federal Rules of Criminal Procedure]...." United States v. Igoe, 331 F.2d 766, 768 (7th Cir. 1964). Stepping beyond the limits of those Ruleseither by applying a power not granted or one expressly excludedsupports use of the writ if irreparable harm has been demonstrated.
We are satisfied that the Government has adequately shown the possibility of irreparable harm and that issuance of the writ is appropriate under the circumstances of this case. Our decision to issue the writ renders it unnecessary for us to reach the Government's appeal, and so we have no need to resolve definitively the question of appellate jurisdiction.
The district court committed patent error in its application of Rules 11(e) and 35(a), and the Government has demonstrated irreparable harm arising from those errors. We therefore GRANT the petition to issue a writ of mandamus and VACATE the district court's May 10 vacatur of the plea and sentence. We further ORDER that judgment be entered pursuant to the May 3, 2007 sentence pronounced by the district court, and DISMISS the Government's appeal as unnecessary.
