delivered the opinion of the Court.
Petitioner, a state prisoner, applied to the District Court for the Southern District of Illinois for a writ of habeas corpus pursuant to 28 U. S. C. § 2254. The Magistrate to whom the District Court referred the case ordered the State of Illinois to file an answer; the State instead filed a motion to dismiss under Rule 12(b)(6) of the Federal Rules of Civil Procedure, arguing that the petition failed to state a claim upon which relief could be granted. The District Court adopted the Magistrate’s recommendation and dismissed the petition on the merits. When petitioner appealed to the Court of Appeals for the Seventh Circuit, respondent for the first time interposed the defense that petitioner had not exhausted his state remedies.
1
In response, petitioner contended that the State had waived that defense by failing to raise it in the District Court. The Court of Appeals rejected the waiver argument and remanded the cause to the District Court with instructions to dismiss without prejudice.
Granberry
v.
Mizell,
*131 How an appellate court ought to handle a nonexhausted ha-beas petition when the State has not raised this objection in the district court is a question that might be answered in three different ways. We might treat the State’s silence on the matter as a procedural default precluding the State from raising the issue on appeal. 3 At the other extreme, we might treat nonexhaustion as an inflexible bar to consideration of the merits of the petition by the federal court, and therefore require that a petition be dismissed when it appears that there has been a failure to exhaust. 4 Or, third, we might adopt an intermediate approach and direct the courts of appeals to exercise discretion in each case to decide whether the administration of justice would be better served by insisting on exhaustion or by reaching the merits of the petition forthwith.
We have already decided that the failure to exhaust state remedies does not deprive an appellate court of jurisdiction to consider the merits of a habeas corpus application. See
Strickland
v.
Washington,
*132
We have also expressed our reluctance to adopt rules that allow a party to withhold raising a defense until after the “main event” — in this case, the proceeding in the District Court — is over. See
Wainwright
v.
Sykes,
We are not persuaded by either of the extreme positions. The appellate court is not required to dismiss for non-exhaustion notwithstanding the State’s failure to raise it, and the court is not obligated to regard the State’s omission as an absolute waiver of the claim. Instead, we think the history of the exhaustion doctrine, as recently reviewed in
Rose
v.
Lundy,
“The exhaustion doctrine existed long before its codification by Congress in 1948. In Ex parte Royall,117 U. S. 241 , 251 (1886), this Court wrote that as a matter of comity, federal courts should not consider a claim in a habeas corpus petition until after the state courts have had an opportunity to act:
“‘The injunction to hear the case summarily, and thereupon “to dispose of the party as law and justice require” does not deprive the court of discretion as to the time and mode in which it will exert the powers conferred upon it. That discretion should be exercised in the light of the relations existing, under our system of government, between the judicial tribunals of the Union and of the States, and in recognition of the fact that the public good requires that those relations be not disturbed by unnecessary conflict between courts equally bound to guard and protect rights secured by the Constitution.’
*134 “Subsequent cases refined the principle that state remedies must be exhausted except in unusual circumstances. See, e. g., United States ex rel. Kennedy v. Tyler,269 U. S. 13 , 17-19 (1925) (holding that the lower court should have dismissed the petition because none of the questions had been raised in the state courts. ‘In the regular and ordinary course of procedure, the power of the highest state court in respect of such questions should first be exhausted’). In Ex parte Hawk,321 U. S. 114 , 117 (1944), this Court reiterated that comity was the basis for the exhaustion doctrine: ‘it is a principle controlling all habeas corpus petitions to the federal courts, that those courts will interfere with the administration of justice in the state courts only “in rare cases where exceptional circumstances of peculiar urgency are shown to exist.’”
“In 1948, Congress codified the exhaustion doctrine in 28 U. S. C. §2254, citing Ex parte Hawk as correctly stating the principle of exhaustion.” Id., at 515-516 (footnotes omitted).
When the State answers a habeas corpus petition, it has a duty to advise the district court whether the prisoner has, in fact, exhausted all available state remedies. See n. 5, supra. As this case demonstrates, however, there are exceptional cases in which the State fails, whether inadvertently or otherwise, to raise an arguably meritorious non-exhaustion defense. The State’s omission in such a case makes it appropriate for the court of appeals to take a fresh look at the issue. The court should determine whether the interests of comity and federalism will be better served by addressing the merits forthwith or by requiring a series of additional state and district court proceedings before reviewing the merits of the petitioner’s claim.
If, for example, the case presents an issue on which an unresolved question of fact or of state law might have an impor
*135
tant bearing, both comity and judicial efficiency may make it appropriate for the court to insist on complete exhaustion to make sure that it may ultimately review the issue on a fully informed basis. On the other hand, if it is perfectly clear that the applicant does not raise even a colorable federal claim, the interests of the petitioner, the warden, the state attorney general, the state courts, and the federal courts will all be well served even if the State fails to raise the exhaustion defense, the district court denies the habeas petition, and the court of appeals affirms the judgment of the district court forthwith. See
United States ex rel. Allum
v.
Twomey,
Conversely, if a full trial has been held in the district court and it is evident that a miscarriage of justice has occurred, it may also be appropriate for the court of appeals to hold that the nonexhaustion defense has been waived in order to avoid unnecessary delay in granting relief that is plainly warranted. In
Frisbie
v.
Collins,
In this case the Court of Appeals simply held that the nonexhaustion defense could not be waived, and made no attempt to determine whether the interests of justice would be better served by addressing the merits of the habeas petition or by requiring additional state proceedings before doing so. Accordingly, we vacate the judgment of the Court of Appeals and remand the case for further proceedings consistent with this opinion. 9
It is so ordered.
Notes
Before seeking federal relief, petitioner had filed a mandamus action in the Illinois Supreme Court in 1981. That court denied the petition “without prejudice to proceeding in any appropriate circuit court for consideration of the question presented.” App. 10. In 1983, petitioner commenced a second mandamus action in the Illinois Supreme Court, which denied the motion for leave to file a petition for writ of mandamus. Id., at 9.
Compare
Batchelor
v.
Cupp,
Cf.
Wainwright
v.
Sykes,
Cf.
Iowa Mutual Insurance Co.
v.
LaPlante,
Rule 5 of the Rules governing § 2254 eases in the United States district courts requires that the answer to a habeas petition “shall state whether the petitioner has exhausted his state remedies including any post-conviction remedies available to him under the statutes or procedural rules of the state. . . .” The State’s Rule 12(b)(6) motion and accompanying brief did not contain this required statement. App. 12-17. The State represents that this omission “was a mistake on the part of the assistants, on the part of the assistant attorney general. . . . The assistant was not even aware of the exhaustion requirement.” Tr. of Oral Arg. 29, 38 (counsel for respondent).
It is also true, of course, that the Magistrate, upon receipt of the Rule 12(b)(6) motion, did not then ask the State to make a Rule 5 statement of whether petitioner had exhausted his state remedies. Instead, the Magistrate gave notice to petitioner that the State had filed a motion to dismiss with “an affidavit or other documentary evidence,” and that accordingly, under Rule 56(c) of the Federal Rules of Civil Procedure, petitioner could not “rest upon the mere allegations of your Petition,” but must send affidavits establishing a genuine issue for trial. Record Doc. No. 7. Petitioner filed a response, and the Magistrate then issued his Report and Recommendation that the motion to dismiss be granted. The District Court adopted this recommendation and dismissed the action, without referring to the exhaustion issue. App. 18-21.
The State can successfully defend a habeas action either by obtaining dismissal for failure to exhaust or by winning on the merits, while the prisoner can only obtain the relief he seeks if the court reaches the merits and *133 rules in his favor. A rule requiring dismissal when the defense of nonexhaustion is raised at the appellate level for the first time therefore would never operate to the prisoner’s benefit. If the prisoner obtains relief in district court, the State could assert this rule to obtain a reversal on appeal, while conversely, if the district court denies habeas relief and the prisoner appeals, the rule requiring dismissal would not result in reversal of the denial of habeas relief.
The Rules governing §2254 cases in the United States district courts leave open this possibility. While the Magistrate requested the State to file an answer in this case, Rule 4 authorizes a district judge summarily to dismiss a habeas petition if “it plainly appears from the face of the petition and any exhibits annexed to it that the petitioner is not entitled to relief in the district court.” If the petition is not summarily dismissed, “the judge shall order the respondent to file an answer or other pleading. ...” The answer “shall state whether the petitioner has exhausted his state remedies.” Rule 5. Thus, the District Court’s dismissal of a nonmeritorious petition under Rule 4 pretermits consideration of the issue of non-exhaustion. Similarly, it is appropriate for the court of appeals to dispose of nonmeritorious petitions without reaching the nonexhaustion issue.
See,
e. g., Marino
v.
Ragen,
Petitioner has also contested the Court of Appeals’ determination that he failed to exhaust his state remedies.
Granberry
v.
Mizell,
