                           PUBLISHED

UNITED STATES COURT OF APPEALS
                FOR THE FOURTH CIRCUIT


RODNEY ELMER ANDERSON,                 
              Plaintiff-Appellant,
                 v.
XYZ CORRECTIONAL HEALTH
SERVICES, INC.; RONALD J. ANGELONE;
D. A. GARRAGHTY; M. C. MILLARD;
JOHN DOE; DOCTOR SWETTER,                       No. 04-6885
               Defendants-Appellees,
                and
ANDREW J. WINSTON; JAMES A.
SMITH; K. W. DAVIS; MR. ZUMMER;
MARSHA FORESMAN,
                       Defendants.
                                       
           Appeal from the United States District Court
        for the Eastern District of Virginia, at Alexandria.
                 Gerald Bruce Lee, District Judge.
                          (CA-02-1045)

                      Argued: February 2, 2005

                       Decided: May 17, 2005

     Before MOTZ, TRAXLER, and SHEDD, Circuit Judges.



Reversed and remanded by published opinion. Judge Traxler wrote
the opinion, in which Judge Motz and Judge Shedd joined.
2         ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
                             COUNSEL

ARGUED: Jeffrey Bromme, ARNOLD & PORTER, L.L.P., Wash-
ington, D.C., for Appellant. Joel Christopher Hoppe, Assistant Attor-
ney General, OFFICE OF THE ATTORNEY GENERAL OF
VIRGINIA, Richmond, Virginia, for Appellees. ON BRIEF: Eliza-
beth A. High, ARNOLD & PORTER, L.L.P., Washington, D.C., for
Appellant. Jerry W. Kilgore, Attorney General of Virginia, Richard
L. Savage, III, Deputy Attorney General, Richmond, Virginia, for
Appellees Ronald J. Angelone, D. A. Garraghty, and M. C. Millard.


                              OPINION

TRAXLER, Circuit Judge:

   The Prison Litigation Reform Act (the "PLRA") requires that
inmates exhaust all administrative remedies before filing an action
challenging prison conditions under federal law. See 42 U.S.C.A.
§ 1997e(a) (West 2003). The question in this case is whether this
requirement imposes a heightened pleading obligation on the inmate,
such that a district court may sua sponte dismiss a complaint that fails
to allege exhaustion of remedies. While the circuit courts have not
spoken uniformly, most of the courts that have considered the ques-
tion have held that exhaustion of administrative remedies is not a
pleading requirement. In this case, however, the district court was
persuaded by the minority approach and concluded that exhaustion
must be alleged in the complaint. The court therefore sua sponte dis-
missed a complaint filed by Rodney Anderson for failure to suffi-
ciently allege exhaustion. Anderson appeals.

   We conclude that the PLRA does not require a prisoner to allege
that he has exhausted his administrative remedies, so that a district
court may not dismiss a complaint that fails to allege exhaustion, at
least not before giving the prisoner an opportunity to address the
exhaustion question. Accordingly, we reverse the decision of the dis-
trict court and remand for further proceedings.

                                   I.

   Rodney Anderson was an inmate in the custody of the Michigan
state prison system. In 1999, however, he was transferred to a prison
          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                   3
in Virginia, where he was housed for approximately ten months.
While in Virginia, Anderson broke his arm, and he claims that the
Virginia officials failed to provide him proper medical treatment.

   In 2002, Anderson filed a complaint against various Virginia prison
officials. In his complaint, Anderson asserted, by way of § 1983, that
the defendants violated the Eighth Amendment. Anderson also
included various claims under state law. Two of the defendants filed
a motion to dismiss, contending the federal claims were not cogniza-
ble under § 1983 and that the state claims were barred under various
Virginia statutes of limitation. Anderson filed a response in which he
addressed the claims raised by Virginia in its motion to dismiss.

   The district court thereafter dismissed Anderson’s complaint on an
issue not raised in the motion to dismiss—Anderson’s failure to plead
in his complaint that he had exhausted his administrative remedies.1
Anderson filed a motion to reconsider, arguing that he had not been
given an opportunity to address the exhaustion issue. The district
court denied the motion, and this appeal followed.

                                    II.

   In response to an ever-growing number of prison-condition law-
suits that were threatening to overwhelm the capacity of the federal
judiciary, Congress in 1996 passed the Prison Litigation Reform Act.
See Para-Prof’l Law Clinic v. Beard, 334 F.3d 301, 303 (3d Cir.
2003) ("Congress enacted the PLRA in an apparent effort . . . to dis-
courage prisoners from filing frivolous lawsuits which strain the judi-
ciary’s scarce resources . . . ."); Doe v. Washington County, 150 F.3d
920, 924 (8th Cir. 1998) ("The PLRA was designed to discourage the
initiation of litigation by a certain class of individuals—prisoners—
that is otherwise motivated to bring frivolous complaints as a means
of gaining a short sabbatical in the nearest Federal courthouse." (inter-
nal quotation marks omitted)). The PLRA imposes a number of
restrictions on an inmate’s ability to initiate civil litigation. For exam-
ple, after the PLRA, inmates can no longer use the in forma pauperis
  1
    Although one of the defendants alleged in his answer that Anderson
failed to exhaust his administrative remedies, that defendant did not file
a motion to dismiss.
4         ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
statute to avoid paying filing fees, but must instead pay all filing fees
without regard to their financial status. See 28 U.S.C.A. § 1915(b)(1)
(West Supp. 2004). The PLRA also authorizes a district court to sua
sponte dismiss prison-condition lawsuits "if the court is satisfied that
the action is frivolous, malicious, fails to state a claim upon which
relief can be granted, or seeks monetary relief from a defendant who
is immune from such relief." 42 U.S.C.A. § 1997e(c).

   Of importance to this case is the PLRA’s exhaustion-of-remedies
requirement. As a general rule, plaintiffs proceeding under § 1983
need not exhaust state administrative remedies before filing suit. See
Porter v. Nussle, 534 U.S. 516, 523 (2002); Patsy v. Board of
Regents, 457 U.S. 496, 516 (1982). The PLRA, however, reversed
that rule as to prison-condition lawsuits. See 42 U.S.C.A. § 1997e(a)
("No action shall be brought with respect to prison conditions under
section 1983 of this title, or any other Federal law, by a prisoner con-
fined in any jail, prison, or other correctional facility until such
administrative remedies as are available are exhausted."). There is no
doubt that the PLRA’s exhaustion requirement is mandatory. See Por-
ter, 534 U.S. at 524 ("Once within the discretion of the district court,
exhaustion in cases covered by § 1997e(a) is now mandatory. All
available remedies must now be exhausted; those remedies need not
meet federal standards, nor must they be plain, speedy, and effective.
Even when the prisoner seeks relief not available in grievance pro-
ceedings, notably money damages, exhaustion is a prerequisite to
suit." (citations and internal quotation marks omitted)). The question
we must answer is whether this exhaustion-of-remedies requirement
is a pleading requirement as well, such that a complaint is subject to
dismissal if it fails to include an allegation that the inmate has
exhausted his administrative remedies.

   A majority of the circuit courts of appeals considering the question
have concluded that exhaustion of administrative remedies need not
be alleged by the plaintiff in his complaint but is instead an affirma-
tive defense to be raised by the defendant. See Wyatt v. Terhune, 315
F.3d 1108, 1119 (9th Cir. 2003); Casanova v. DuBois, 304 F.3d 75,
77 (1st Cir. 2002); Ray v. Kertes, 285 F.3d 287, 295 (3d Cir. 2002);
Foulk v. Charrier, 262 F.3d 687, 697 (8th Cir. 2001); Massey v. Hel-
man, 196 F.3d 727, 735 (7th Cir. 1999); Jenkins v. Haubert, 179 F.3d
19, 28-29 (2d Cir. 1999); see also Jackson v. District of Columbia,
          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                5
254 F.3d 262, 267 (D.C. Cir. 2001) (suggesting but not directly hold-
ing that exhaustion is an affirmative defense). Only two circuits have
concluded that exhaustion is a pleading requirement borne by the
plaintiff, so that failure to allege exhaustion makes the complaint sub-
ject to dismissal by the district court. See Steele v. Federal Bureau of
Prisons, 355 F.3d 1204, 1209 (10th Cir. 2003); Brown v. Toombs, 139
F.3d 1102, 1104 (6th Cir. 1998) (per curiam). As we explain below,
we agree with the majority approach and conclude that the PLRA
does not require that an inmate allege in his complaint that he has
exhausted all administrative remedies.

                                  A.

   If the PLRA’s exhaustion-of-remedies requirement were one that
implicated the district court’s subject-matter jurisdiction, then there
would be no question that an inmate would be obliged to allege
exhaustion in his complaint. See Pinckley, Inc. v. City of Frederick,
Md., 191 F.3d 394, 399 (4th Cir. 1999) ("Federal courts are courts of
limited subject matter jurisdiction, and as such there is no presump-
tion that the court has jurisdiction. Thus the facts providing the court
jurisdiction must be affirmatively alleged in the complaint." (citation
omitted)); Fed. R. Civ. P. 8(a) (stating that complaints must contain
"a short and plain statement of the grounds upon which the court’s
jurisdiction depends").

   Every court to have considered the question has concluded that
§ 1997e(a)’s exhaustion requirement is not a jurisdictional require-
ment. See Steele, 355 F.3d at 1208; Richardson v. Goord, 347 F.3d
431, 434 (2d Cir. 2003) (per curiam); Casanova v. DuBois, 289 F.3d
142, 147 (1st Cir. 2002); Ali v. District of Columbia, 278 F.3d 1, 5-
6 (D.C. Cir. 2002); Wright v. Hollingsworth, 260 F.3d 357, 358 n.2
(5th Cir. 2001); Chelette v. Harris, 229 F.3d 684, 688 (8th Cir. 2000);
Nyhuis v. Reno, 204 F.3d 65, 69 n.4 (3d Cir. 2000); Massey, 196 F.3d
at 732; Wyatt v. Leonard, 193 F.3d 876, 879 (6th Cir. 1999); Rumbles
v. Hill, 182 F.3d 1064, 1068 (9th Cir. 1999), overruled on other
grounds by Booth v. Churner, 532 U.S. 731, 740-41 (2001). We
agree.

  While Congress could have provided that a district court lacks
subject-matter jurisdiction in prison-condition cases unless the inmate
6          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
has exhausted his administrative remedies, the PLRA does not do
that. To the contrary, the structure of the PLRA itself clearly indicates
that exhaustion of remedies is not a jurisdictional requirement.

    Section 1997e(c)(2) states that:

         In the event that a claim is, on its face, frivolous, mali-
      cious, fails to state a claim upon which relief can be granted,
      or seeks monetary relief from a defendant who is immune
      from such relief, the court may dismiss the underlying claim
      without first requiring the exhaustion of administrative rem-
      edies.

42 U.S.C.A. § 1997e(c)(2). Section 1997e(c)(2) clearly contemplates
the dismissal on the merits of some claims that have not been
exhausted. Because a district court must have subject-matter jurisdic-
tion before it can dismiss a claim on the merits, failure to exhaust can-
not be viewed as affecting the district court’s subject-matter
jurisdiction over the claim. See Chelette, 229 F.3d at 687 ("Because
the existence of jurisdiction is a prerequisite to the evaluation and dis-
missal of a claim on its merits, it follows that jurisdiction is not
divested by the failure to exhaust administrative remedies."); Under-
wood v. Wilson, 151 F.3d 292, 295 (5th Cir. 1998) (per curiam) ("The
statute provides that the court may dismiss such claims without
requiring the exhaustion of administrative remedies. The court would
not be empowered to do so if the exhaustion provision deprived the
court of jurisdiction over the action." (citation omitted)). We therefore
conclude that the PLRA’s exhaustion-of-remedies requirement does
not operate as a bar to the district court’s exercise of its subject-matter
jurisdiction.

                                    B.

   Because exhaustion of remedies is not a jurisdictional requirement,
we must determine whether the PLRA otherwise makes exhaustion a
pleading requirement.

   The appellate courts that have found exhaustion to be a pleading
requirement—to date, only the Sixth and Tenth Circuits—have
          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                7
focused on the fact that the exhaustion of remedies required by the
PLRA is mandatory. See Porter, 534 U.S. at 524 ("Once within the
discretion of the district court, exhaustion in cases covered by
§ 1997e(a) is now mandatory."). These courts concluded, in essence,
that because exhaustion is mandatory under the PLRA, then it must
be a pleading requirement. The Tenth Circuit’s analysis in Steele is
illustrative:

    Our . . . conclusion is compelled by the Supreme Court’s
    emphasis on the mandatory nature of exhaustion, implica-
    tions of the PLRA statutory scheme, the structure of the
    Rules of Civil Procedure and our own precedent. We decline
    to characterize exhaustion as an affirmative defense because
    it cannot be waived. Under Federal Rule of Civil Procedure
    8(c), a failure to plead an affirmative defense results in a
    waiver of that defense. . . .

      . . . [C]lassification of the PLRA’s exhaustion require-
    ment as an affirmative defense means that defendants may
    choose to ignore it for their own strategic reasons. This
    court, however, has warned against trivializing the Supreme
    Court’s holding that exhaustion is now mandatory.

Steele, 355 F.3d at 1209 (citations, internal quotation marks, and
alterations omitted). While the Sixth Circuit’s analysis of the issue is
abbreviated, concerns similar to those articulated by the Tenth Circuit
seem to have guided its decision. See Brown, 139 F.3d at 1104 ("In
light of the plain mandatory language of the statute regarding exhaus-
tion of remedies, the legislative purpose underlying the plain lan-
guage, and the sound policy on which it is based, this court will
henceforth require that prisoners filing § 1983 cases involving prison
conditions must allege and show that they have exhausted all avail-
able state administrative remedies."); see also Knuckles El v. Toombs,
215 F.3d 640, 642 (6th Cir. 2000) (explaining that the rule announced
in Brown was necessary because the PLRA provides that "no action
shall be brought until all available administrative remedies are
exhausted" and requiring plaintiff to allege exhaustion permits the
district court to "intelligently decide if the issues raised can be
decided on the merits").
8          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
   These circuits thus seem to view the PLRA as having created a
requirement that is not jurisdictional, but yet is not forfeitable, such
that compliance with the requirement must be addressed sua sponte
by the district court. This circuit, however, has rejected that sort of
analysis, albeit in a different context. See Brickwood Contractors, Inc.
v. Datanet Eng’g, Inc., 369 F.3d 385 (4th Cir. 2004) (en banc).

   In Brickwood, we concluded that the "safe-harbor" provision gov-
erning the imposition of sanctions under Rule 11, see Fed. R. Civ. P.
11(c)(1)(A), created a mandatory condition precedent to the imposi-
tion of sanctions under the rule.2 See id. at 389. However, because
Rule 11(c)(1)(A) does not implicate the district court’s subject-matter
jurisdiction, see id. at 392, we concluded that the safe-harbor protec-
tions, though mandatory, could be forfeited by a defendant who fails
to timely raise them, see id. at 396. In reaching that conclusion, we
rejected the suggestion that there might be a category of rules "which
do not implicate a court’s subject-matter jurisdiction, but are nonethe-
less not forfeitable by a party, and which must be enforced by a court
without regard to whether compliance with the rule was timely (or
ever) raised by the appropriate party." Id. at 395.

   Our decision in Brickwood, of course, does not directly control our
disposition of this case.3 Nonetheless, we think that the analysis in
    2
     The Rule 11 language at issue in Brickwood is similar to the PLRA
language at issue in this appeal. The PLRA provides that no prison-
conditions action "shall be brought" unless the plaintiff has exhausted his
administrative remedies. 42 U.S.C.A. § 1997e(a). Rule 11’s safe-harbor
provision states that a motion seeking sanctions "shall not be filed with
or presented to the court" unless the party seeking sanctions served the
motion on the other party at least twenty-one days before the motion is
filed with the court. Fed. R. Civ. P. 11(c)(1)(A).
   3
     While this case involves the effect of a mandatory statute, at issue in
Brickwood was the effect of a mandatory court rule. As mentioned
above, Congress by statute can restrict the district court’s subject-matter
jurisdiction. Court rules, however, cannot restrict jurisdiction that has
been created by statute. See Kontrick v. Ryan, 540 U.S. 443, 452 (2004)
("Only Congress may determine a lower federal court’s subject-matter
jurisdiction."); Owen Equip. & Erection Co. v. Kroger, 437 U.S. 365,
370 (1978) ("[I]t is axiomatic that the Federal Rules of Civil Procedure
do not create or withdraw federal jurisdiction.").
           ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                   9
Brickwood suggests that it would be improper to conclude, as did the
Sixth and Tenth Circuits, that simply because the PLRA’s exhaustion
requirement is mandatory, it cannot be waived or forfeited by the
defendant. Cf. Kontrick v. Ryan, 540 U.S. 443, 456 (2004) (noting the
difference between a rule of subject-matter jurisdiction and a manda-
tory but non-jurisdictional rule: "[A] court’s subject-matter jurisdic-
tion cannot be expanded to account for the parties’ litigation conduct;
a claim-processing rule, on the other hand, even if unalterable on a
party’s application, can nonetheless be forfeited if the party asserting
the rule waits too long to raise the point." (emphasis added)); Perez
v. Wisconsin Dep’t of Corr., 182 F.3d 532, 536 (7th Cir. 1999)
("Filing suit before exhausting prison remedies . . . is not the sort of
defect that judges must notice even if the defendant is happy to con-
test the suit on the merits. . . . The statute gives prisons and their offi-
cials a valuable entitlement—the right not to face a decision on the
merits—which courts must respect if a defendant chooses to invoke
it." (first and third emphasis added)). Accordingly, we reject any sug-
gestion that the mandatory nature of the PLRA’s exhaustion require-
ment compels the conclusion that exhaustion of remedies must be
alleged by an inmate in his complaint.

                                    C.

   In our view, the question of whether the PLRA’s exhaustion
requirement imposes a heightened pleading obligation on the plaintiff
is one that is answered by a simple review of the relevant statutory
language.

  The PLRA specifies that district courts shall sua sponte dismiss
certain prison-condition complaints:

     The court shall on its own motion or on the motion of a
     party dismiss any action . . . if the court is satisfied that the
     action is frivolous, malicious, fails to state a claim upon
     which relief can be granted, or seeks monetary relief from
     a defendant who is immune from such relief.

42 U.S.C.A. § 1997e(c)(1). The exhaustion-of-remedies requirement
is contained in the same statutory section—§ 1997e(a), just a few
printed lines before the subsection listing grounds for dismissal.
10        ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
Under these circumstances, it seems to us that the absence of failure-
to-exhaust as grounds for dismissal in § 1997e(c)(1) must be viewed
as an intentional congressional omission.

     Congress had not forgotten about the need for exhaustion,
     but chose not to include failure to exhaust among the
     grounds for which the court could dismiss sua sponte. Inas-
     much as the omission of failure to exhaust from the catego-
     ries explicitly permitting sua sponte dismissal is found in
     § 1997e, the same section of the PLRA that sets out the
     exhaustion requirement, the inference is inescapable that
     Congress did not intend to include failure to exhaust among
     the categories justifying sua sponte dismissal.

Ray, 285 F.3d at 296 (footnotes omitted); see also United States v.
Vonn, 535 U.S. 55, 65 (2002) (explaining that the statutory-
construction canon expressio unius est exclusio alterius is applicable
to statutes that refer to members of an "associated group or series,"
so as to justify the inference that the items not mentioned were
excluded deliberately rather than inadvertently); Russello v. United
States, 464 U.S. 16, 23 (1983) ("Where Congress includes particular
language in one section of a statute but omits it in another section of
the same Act, it is generally presumed that Congress acts intentionally
and purposely in the disparate inclusion or exclusion." (internal quo-
tation marks and alteration omitted)).

   Moreover, in § 1997e(c)(2), Congress made it clear that when dis-
missing a complaint under a ground listed in § 1997e(c)(1), the dis-
trict court need not first require the inmate to exhaust his
administrative remedies. See 42 U.S.C.A. § 1997e(c)(2) ("In the event
that a claim is, on its face, frivolous, malicious, fails to state a claim
upon which relief can be granted, or seeks monetary relief from a
defendant who is immune from such relief, the court may dismiss the
underlying claim without first requiring the exhaustion of administra-
tive remedies." (emphasis added)). This statutory directive further
demonstrates that Congress clearly considered the interplay of the
exhaustion requirement with the district court’s obligation to dismiss
some complaints sua sponte, and yet decided not to include failure to
exhaust as a basis for sua sponte dismissal. It thus is not for us to read
failure-to-exhaust into § 1997e(c)(2). See, e.g., United States v. Bran-
          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                 11
don, 247 F.3d 186, 190 (4th Cir. 2001) (noting "the fundamental prin-
ciple of statutory construction that courts are obligated to give effect
to Congress’s decision to use different language in proximate subsec-
tions of the same statute." (internal quotation marks omitted)); United
States v. Childress, 104 F.3d 47, 53 (4th Cir. 1996) ("Congress’ role
is to enact statutes; the judiciary’s to interpret those statutes as writ-
ten.").
   The defendants, however, argue that because exhaustion is manda-
tory, failing to allege exhaustion is the equivalent of failing to state
a claim upon which relief can be granted. Thus, according to the
defendants, a district court may, pursuant to § 1997e(c)(2), dismiss a
complaint that does not allege exhaustion. We disagree.
   If Congress had been less precise when drafting the PLRA, then
perhaps this argument would be more persuasive. But § 1997e(c)
quite clearly does not treat a failure to allege exhaustion as the equiv-
alent of a failure to state a claim. As noted above, § 1997e(c)(1)
requires a district court to dismiss a complaint that fails to state a
claim for which relief can be granted, while § 1997e(c)(2) states that
the court may dismiss a complaint under subsection (c)(1) without
first requiring the inmate to exhaust his administrative remedies. If,
as the defendants argue, "failure to state a claim included failure to
exhaust for purposes of Section 1997e(c), then paragraph (2) would
carry the highly improbable meaning that courts may dismiss for fail-
ure to exhaust administrative remedies without first requiring exhaus-
tion of administrative remedies." Snider v. Melindez, 199 F.3d 108,
111 (2d Cir. 1999). Accordingly, we reject the contention that an
inmate’s failure to allege exhaustion of remedies amounts to a failure
to state a claim upon which relief can be granted.
                                   D.
   In our view, the language and structure of the PLRA make it clear
that an inmate is not required to allege exhaustion of remedies in his
§ 1983 prison-conditions complaint. Instead, an inmate’s failure to
exhaust his administrative remedies must be viewed as an affirmative
defense that should be pleaded or otherwise properly raised by the
defendant. See, e.g., Wyatt, 315 F.3d at 1119 ("[N]onexhaustion under
§ 1997e(a) of the PLRA does not impose a pleading requirement. We
hold that § 1997e(a) creates a defense—defendants have the burden
12        ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
of raising and proving the absence of exhaustion."); Ray, 285 F.3d at
295 ("We thus join the many other circuits that have held that failure
to exhaust is an affirmative defense to be pleaded by the defendant.");
Foulk, 262 F.3d at 697 ("[R]eliance upon the PLRA exhaustion
requirement is an affirmative defense . . . ."). We pause to emphasize,
however, that our determination that failure-to-exhaust is an affirma-
tive defense does not foreclose in all cases the possibility of a sua
sponte dismissal on exhaustion grounds.
   In Nasim v. Warden, 64 F.3d 951 (4th Cir. 1995) (en banc), we
concluded that the district court’s authority to sua sponte dismiss an
in forma pauperis case as frivolous was broad enough to permit the
court to dismiss a complaint on the basis of an affirmative defense
that was apparent from the facts alleged in the complaint. See id. at
954-55; see also Todd v. Baskerville, 712 F.2d 70, 74 (4th Cir. 1983)
(affirming § 1915(d) dismissal of actions which appeared on their
face to be barred by statute of limitations).4 While it seems unlikely
that the failure to exhaust administrative remedies will often be appar-
ent from the face of a complaint, it is certainly possible that a com-
plaint may clearly show that an inmate has not exhausted his
administrative remedies. In such a case, sua sponte dismissal under
Nasim would be appropriate.
   Morever, we have recognized in the habeas context that a district
court has the authority to sua sponte raise an affirmative defense
(timeliness of the habeas filing) as grounds for dismissal, so long as
the court gives the petitioner an opportunity to respond. See McMillan
v. Jarvis, 332 F.3d 244, 249-50 (4th Cir. 2003); Hill v. Braxton, 277
F.3d 701, 706-07 (4th Cir. 2002). We found such an approach proper
because the statutory time-limit for filing habeas petitions "implicates
  4
   Nasim was decided before the PLRA was enacted, and it involved 28
U.S.C.A. § 1915 (West Supp. 2004), the generally applicable in forma
pauperis ("IFP") statute. Nonetheless, Nasim is applicable to PLRA
cases. The PLRA and the IFP statute are closely related. Many sections
of the PLRA are simply amendments to the IFP statute, and most of the
cases now brought under the PLRA would previously have been brought
under the IFP statute. Moreover, Nasim’s holding was premised on the
broad discretion that the IFP statute gave the district court to screen out
meritless cases, see Nasim, 64 F.3d at 954-55, discretion that likewise
forms an integral part of the PLRA, see 42 U.S.C.A. § 1997e(c).
          ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES                13
values beyond the interests of the parties and, in particular, promotes
judicial efficiency and conservation of judicial resources." Hill, 277
F.3d at 706 (internal quotation marks omitted). Similar concerns of
efficiency and conservation of scarce judicial resources, of course,
underlie the PLRA in general and its exhaustion requirement in par-
ticular. See, e.g., Porter, 534 U.S. at 524-25 ("Beyond doubt, Con-
gress enacted § 1997e(a) to reduce the quantity and improve the
quality of prisoner suits; to this purpose, Congress afforded correc-
tions officials time and opportunity to address complaints internally
before allowing the initiation of a federal case. In some instances, cor-
rective action taken in response to an inmate’s grievance might
improve prison administration and satisfy the inmate, thereby obviat-
ing the need for litigation. In other instances, the internal review
might filter out some frivolous claims. And for cases ultimately
brought to court, adjudication could be facilitated by an administra-
tive record that clarifies the contours of the controversy." (citations
and internal quotation marks omitted)). In the context of PLRA
claims, then, we believe it is appropriate to recognize that district
courts have the same authority to inquire into the applicability of an
affirmative defense as in the habeas context. Such a conclusion gives
some teeth to the PLRA’s exhaustion requirement, yet does not do a
disservice to the statutory language carefully chosen by Congress.
   Accordingly, we conclude that a district court may raise the issue
of exhaustion of remedies on its own motion. Except in the rare case
where failure to exhaust is apparent from the face of the complaint,
however, a district court cannot dismiss the complaint without first
giving the inmate an opportunity to address the issue.5 See Snider v.
Melindez, 199 F.3d 108, 113 (2d Cir. 1999) ("[W]hile the district
court was free to [raise exhaustion of remedies] on its own motion,
it erred in dismissing the complaint without giving Snider notice and
an opportunity be heard in opposition."); cf. McMillan, 332 F.3d at
249-50 (explaining that a district court may not sua sponte dismiss a
  5
   District courts taking this approach must exercise caution. To deter-
mine whether an inmate has exhausted his administrative remedies
requires an understanding of the remedies available and thus likely
would require information from the defendant as well as the inmate. See
Mojias v. Johnson, 351 F.3d 606, 610-11 (2d Cir. 2003); Snider, 199
F.3d at 113-14.
14         ANDERSON v. XYZ CORRECTIONAL HEALTH SERVICES
habeas petition as untimely without first giving the petitioner an
opportunity to respond).
                                    III.
   Accordingly, for the foregoing reasons, we conclude that the
PLRA’s exhaustion-of-remedies requirement does not impose a
heightened pleading obligation on an inmate. Instead, an inmate’s
failure to exhaust administrative remedies is an affirmative defense to
be pleaded and proven by the defendant. That exhaustion is an affir-
mative defense, however, does not preclude the district court from
dismissing a complaint where the failure to exhaust is apparent from
the face of the complaint, nor does it preclude the district court from
inquiring on its own motion into whether the inmate exhausted all
administrative remedies. Because the district court in this case dis-
missed Anderson’s complaint on exhaustion grounds without giving
him an opportunity to respond to the issue,6 we reverse the judgment
of the district court and remand for further proceedings. Given our
disposition of this issue, we need not consider whether Anderson suf-
ficiently alleged exhaustion in his complaint, as he contends. We like-
wise decline to consider whether the PLRA’s requirements apply to
claims brought under state law.7
                                           REVERSED AND REMANDED

  6
     Although Anderson filed a motion under Rule 59(e) in which he
asserted that he had exhausted his remedies, a motion to alter or amend
the judgment does not provide an inmate with an adequate opportunity
to address the exhaustion issue. See Hill v. Braxton, 277 F.3d 701, 708
(4th Cir. 2002) ("Rule 59(e) is not an adequate avenue for the petitioner
to pursue a tolling argument because it affords a narrower basis for relief
than is available prior to entry of a judgment.").
   7
     We note that the defendants contend that the district court’s decision
should be affirmed because Anderson’s claims are barred by the statute
of limitations. The district court did not address that issue, and the defen-
dants did not file a cross-appeal. We therefore decline to consider the
statute of limitations issue. See El Paso Nat. Gas Co. v. Neztsosie, 526
U.S. 473, 479 (1999); Tug Raven v. Trexler, 419 F.2d 536, 548 (4th Cir.
1969). The district court is free to consider de novo that issue (and any
other not directly addressed in this opinion) should it arise on remand.
