OPINION OF THE COURT
This is an appeal from a judgment of conviction for criminal contempt in the United States District Court for the Middle District of Pennsylvania. Appellant Ronald Pearce was convicted and sentenced to two years’ imprisonment for refusing to comply with a court order compelling him to testify before a grand jury. Because Pearce was denied the opportunity to raise the invalidity of the underlying order as a defense, we vacate the conviction and remand for a new trial.
I.
On September 16, 1982, the government and Ronald Pearce executed a plea bargain agreement in the United States District Court for the Eastern District of Pennsylvania. Pearce pled guilty to conspiracy to manufacture m.ethamphetamine, 21 U.S.C. § 846 (1982) and attempt to manufacture methamphetamine, id. In return for the plea, the government agreed to drop the charge that Pearce distributed methamphetamine and promised not to prosecute Pearce in the Middle District of Pennsylvania for related crimes. The government also promised not to call Pearce as a witness before a grand jury. Subsequent events reveal that the government understood that the promise not to call Pearce as a witness was restricted to grand juries convened in the Eastern District of Pennsylvania, whereas Pearce believed that the promise covered the Middle District of Pennsylvania as well. 1 After a hearing pursuant to Fed.R.Crim.P. 11, the district court accepted the plea agreement and, on *399 October 26, 1982, sentenced Pearce to a term of 5 years’ imprisonment.
In August 1984, during Pearce’s prison term, the government called him to testify before a grand jury sitting in the Middle District of Pennsylvania. Believing that Pearce might invoke his Fifth Amendment right not to testify, the government applied for an immunity order pursuant to 18 U.S.C. § 6001 (1982). A hearing on the application took place on August 31 in the United States District Court for the Middle District of Pennsylvania. Pearce testified that the government had promised him that he would not be called to testify before any grand jury. The government countered by arguing that the terms of Pearce’s plea agreement had been determined in the case of
United States v. Drum,
After Pearce’s testimony and colloquy among the parties, the district court determined that the government’s promise not to call Pearce extended only to the Eastern District. The court granted the immunity order and ordered Pearce to testify, warning him that he faced contempt charges if he defied the order. Later that day, Pearce appeared before the federal grand jury and refused to answer questions on the grounds that his plea arrangement stipulated that he would not have to testify.
On October 11, 1984, the government commenced criminal contempt proceedings against Pearce in the Middle District. Trial was set for November 29, 1984. On November 7, Pearce moved in the Eastern District of Pennsylvania for “specific performance” of his plea agreement. On November 13, Pearce moved for postponement of his contempt trial pending a determination by Judge Fullam as to the actual terms of his plea agreement. The district court denied the motion on the grounds that the terms of Pearce’s plea bargain were irrelevant to the charge of criminal contempt.
The criminal contempt trial commenced on November 29. The government’s case consisted of reading into the record the transcripts of the immunity hearing and the grand jury proceedings. Pearce then moved for a judgment of acquittal. The motion was denied, and the defense rested its case. The jury convicted Pearce of criminal contempt and he was sentenced to two years’ imprisonment.
Although Pearce raises several arguments on appeal, 3 we see potential merit in *400 only one — that the district court erred by precluding a defense at the contempt trial based on the invalidity of the underlying order compelling Pearce to testify. 4
II.
If the terms of the plea bargain protected Pearce from having to testify, then the order compelling him to testify was invalid.
See United States v. Miller,
The rule is that when an order is appealable, and one foregoes the appeal, he may not raise the validity of the order at a subsequent contempt trial; however, if the order is not appealable, and compliance with it will bring irreparable harm, the individual has the option of disobeying the order and raising its invalidity as a defense in subsequent contempt proceedings.
Maness v. Meyers,
The defendant in
Ryan,
like Pearce, was issued a subpoena he regarded as unlawful.
Ryan
addressed the question whether the order was appealable. The defendant argued that unless the order was appealable he was put in the untenable position of being forced to comply with an invalid order. The Court explained, however, that defendant had an option. “[CJompliance is
*401
not the only course open to respondent. If, as he claims, the subpoena is unduly burdensome or otherwise unlawful,
he may refuse to comply and litigate those questions in the event that contempt or similar proceedings are brought against him.” Id.
at 532,
The district court misconstrued this doctrine, believing that the alleged invalidity of the order compelling Pearce to testify was automatically irrelevant to the charge of contempt. This view was manifest in the court’s ruling on Pearce’s motion for a continuance. As noted, Pearce sought a continuance to give Judge Fullam, the sentencing judge, a chance to rule on Pearce’s motion for specific performance of his plea agreement. In its memorandum accompanying its order denying a continuance, the district court explained that even if the order compelling Pearce to testify was invalid, that was no defense to the charge of criminal contempt:
Defendant maintains that if Judge Fullam’s disposition is favorable to him, this action would obviate the need for the pending criminal contempt trial in this district. Defendant is quite mistaken ... Questioning the wisdom, validity or necessity of a court order is not an excuse to a defendant’s refusal to comply with that order.
United States v. Ray,
The district court’s analysis fails to distinguish between situations involving appealable as opposed to non-appealable orders. The above quotation suggests that one who believes a court order invalid should appeal rather than ignore the order. However, Pearce did not have this option because the order compelling him to testify was not appealable.
In Re Grand Jury,
By disobeying the court order, Pearce ran the risk of conviction for contempt in the event the order proved valid. Under Ryan and Maness, at his contempt trial he was entitled to litigate the validity of the order because he could not take an interlocutory appeal from that order. 6
III.
The government alleges, however, that the case at bar is an exception to the Ryan/Maness rule because, at the earlier immunity hearing, Pearce exercised the opportunity to make his argument with respect to the plea bargain. Of course, that hearing preceded the issuance of the order that Pearce disobeyed and thus was not an appeal from or defense against the contempt charge. Nevertheless, the government argues, insofar as the caselaw stands for the proposition that an individual, prior to a conviction for contempt, deserves some meaningful forum to contest the validity of the order he disobeys, the immunity hearing satisfied that requirement.
The determination at the immunity hearing as to the terms of Pearce’s plea agreement could not be
res judicata
at Pearce’s contempt trial, however, because Pearce was not put on notice that the decision at this hearing would be binding in future contempt proceedings. Since the grant of immunity is generally ministerial,
see In Re Grand Jury Investigation,
That Pearce did not regard the immunity hearing as his sole opportunity to make his argument about the plea bargain is clear from the immunity hearing transcript:
PEARCE’S COUNSEL: Based on what you have heard today and what the judge’s ruling is and what his understanding of your agreement or lack of agreement in the Eastern District and the Middle District is, is it your intention to follow the judge’s order and testify or are you going to not testify?
MR. PEARCE: I’m not going to testify. COUNSEL: You intend to test this in some other Court ?
MR. PEARCE: Yes, I do.
Pearce clearly did not regard the immunity hearing as a surrogate for arguing the invalidity of the order compelling him to testify at a criminal contempt trial.
7
Cer
*403
tainly no one told him otherwise. Under the circumstances, the immunity hearing could not suffice as Pearce’s sole opportunity to raise the “plea bargain” defense.
See Mullene v. Central Hanover Bank & Trust Co.,
IV.
Pearce’s only potentially meritorious defense against the charge of criminal contempt was that the order he had disobeyed was invalid. Because the district court incorrectly deprived Pearce of this defense, we shall vacate the judgment of conviction and remand this case for a new trial.
Circuit Judge A. LEON HIGGIN-BOTHAM, Jr. concurs in the result.
Notes
. Pearce’s counsel informed Judge John P. Fu11am, the sentencing judge, that "Mr. Ruch [the prosecutor] has told me he does not intend to call him [Pearce] as a witness” and Judge Fu11am responded that “that is binding as far as this United States Attorney’s office is concerned.” Pearce contends that, in the context of related grand jury investigations in the Eastern and Middle Districts, Judge Fullam’s reference to "this United States Attorney’s Office” covered the Middle District as well as the Eastern District.
.
Drum
involved the contempt trial of John Drum, Pearce’s co-defendant in the underlying drug case. The trial revolved around the very issue alluded to earlier,
i.e.,
whether Pearce and Drum were promised that they would not be required to testify anywhere or only that they would not be required to testify in the Eastern District of Pennsylvania. In
Drum,
the court concluded that the promise not to call Pearce and Drum to testify extended only to the Eastern District. Because Drum had tried to incorporate Pearce’s plea agreement by reference (Drum’s counsel having told Judge Fullam that Drum understood his plea agreement to be in accordance with Pearce’s), the
Drum
case largely involved Pearce’s agreement. The opinion in
Drum,
however, acknowledged possible differences between the terms of Drum’s plea agreement and those of Pearce’s.
Drum,
At the immunity hearing, the government did not suggest that the Drum decision was res judicata as to Pearce. It argued, however, that the court’s determination in Drum as to the terms of Pearce’s and Drum’s plea agreement was obviously relevant.
. Pearce argues that the district court committed reversible error by charging the jury that his subjective belief about the plea bargain was no defense against the charge of contempt. Pearce contends that this charge deprived him of the valid defense that he lacked "intent,” a necessary element of criminal contempt, because he genuinely believed he was immune from having to testify by virtue of his plea agreement. Pearce is correct that criminal intent is an element of the crime of contempt, and must be proven beyond a reasonable doubt.
Commonwealth of Pennsylvania v. Local Union 542, Intern. Union of Operating Engineers,
However, such an approach would encourage frequent disobedience of court orders. Under current doctrine, defendants defying court orders gamble that they will be able to establish the invalidity of the order at contempt proceedings. If the order is judged invalid, the contempt charge does not stand. If it turns out that the order was valid, the defendant is guilty of contempt and cannot successfully advance as a defense his good faith belief that the order was invalid.
Additionally, Pearce argues that the district court and/or the Government erred by not initiating civil contempt proceedings in lieu of criminal contempt proceedings. This claim is also without merit. While the Supreme Court has said that trial judges must consider whether testimony should be coerced through civil contempt proceedings before resort may be had to criminal sanctions,
Shillitani v. United States,
. The government contends that this issue was waived because Pearce did not argue at trial that the order was invalid. We disagree. In his memorandum accompanying his motion for a continuance pending Judge Fullam’s resolution of the plea bargain, Pearce argued that a favorable ruling by Judge Fullam would bar a contempt conviction. The district court’s memorandum accompanying its denial of a continuance,
see infra
p. 401, made clear that a defense based on the invalidity of the underlying order would not be permitted.
See American Home Assurance Co. v. Sunshine Supermarket, Inc.,
.
Halderman v. Pennhurst State School and Hospital,
In
Commonwealth of Pennsylvania v. Local Union 542, Intern. Union of Operating Engineers,
.
United States v. Stine,
[We] hold that the alleged unconstitutionality of probation conditions cannot be raised as a defense to their violation in a probation revocation hearing where the conditions could have been challenged on direct appeal of the judgment of conviction or on an attack on the sentence through a Rule 35 motion____ Reliance on the contempt line of cases requires a reviewing court to insure that there were, in fact, procedures available to the defendant to challenge the condition.
Id. at 846 (emphasis added).
. Indeed the one-day immunity hearing was not treated by any of the parties as a full-scale trial. It is quite possible that if Pearce knew that the immunity hearing posed his sole opportunity to raise the "plea bargain” defense, he would have requested time for discovery or petitioned Judge Fullam for specific performance of his plea bar *403 gain much earlier, rather than waiting for the contempt trial to make such a motion.
Judge Fullam, as the judge before whom the plea bargain was executed, would seem to be in a position to help clarify matters.
See United States v. Arnett,
