#### Frederick BANKS, Plaintiff-Appellant, v. Mark HORNAK; Timothy Pivnichny; Sean Langford; Robert Werner; Adrian Roe; David Hickton; Robert Cessar; Jefferson B. Sessions III; Scott Smith; Federal Bureau of Investigation; James Comey; Mike Pompeo; Central Intelligence Agency; United States Attorney for the Eastern District of North Carolina; United States District Court for the Western District of Pennsylvania; Foreign Intelligence Surveillance Court; Assistant Attorney General on Counterterrorism; Merit Systems Protection Board; United States Marshals Service, Defendants-Appellees.

No. 16-6981

United States Court of Appeals, Fourth Circuit.

Argued: May 9, 2017

Decided: June 27, 2017

*732ARGUED: Robert Matthew Bernstein, KIRKLAND *&*ELLIS LLP, Washington, D.C., for Appellant. Edward Himmelfarb, UNITED STATES DEPARTMENT OF JUSTICE, Washington, D.C., for Appel-lees. ON BRIEF: Erin E. Murphy, KIRKLAND *&*ELLIS LLP, Washington, D.C., for Appellant. Chad A. Readier, Acting Assistant Attorney General, Civil Division, UNITED STATES DEPARTMENT OF JUSTICE, Washington, D.C.; John Stuart Bruce, Acting United States Attorney, OFFICE OF THE UNITED STATES ATTORNEY, Raleigh, North Carolina, for Appellees.

Before NIEMEYER, WYNN, and HARRIS, Circuit Judges.

Unpublished opinions are not binding precedent in this circuit.

WYNN, Circuit Judge:

This case asks us to determine whether 28 U.S.C. § 1915(g) bars Petitioner Frederick Banks from proceeding in forma pau-peris on appeal of the dismissal of his purported mandamus action under 28 U.S.C. § 1361. Section 1915(g), commonly referred to as the “three-strikes rule,” prohibits a prisoner, like Petitioner, from proceeding in forma pauperis if “on 3 or more prior occasions, while incarcerated or detained in any facility, [the prisoner] brought an action or appeal in a court of the United States that was dismissed on the grounds that it is frivolous, malicious, or fails to state a claim upon which relief may be granted.” Petitioner argues that he is not subject to the three-strikes rule because (1) he is not a “prisoner” within the meaning of Section 1915; and (2) his appeal arises from the district court’s dismissal of his petition for mandamus relief, which, Petitioner maintains, is not a “civil action” for purposes of Section 1915(g).

We reject Petitioner’s first argument and find that Petitioner falls within the plain language of the .statute’s definition of a “prisoner” because, at the time he filed his petition, Petitioner was in custody under 18'U.S.C. § 3142(e), which authorizes the pretrial detention of certain criminal defendants. We also reject Petitioner’s attempt to characterize his petition as seeking relief in the preexisting criminal proceedings against him and, instead, conclude that his petition is a “civil action” within the meaning of Section 1915(g). Accordingly, we hold that Petitioner is subject to the three-strikes rule, and we deny Petitioner’s application to proceed in forma pauperis on appeal.

I.

On August 5, 2015, a federal grand jury empaneled by the United States District Court for the Western District of Pennsylvania (the “Pennsylvania district court”) indicted Petitioner on one count of interstate stalking, in violation of 18 U.S.C. § 2261A(2).1 Petitioner pleaded not guilty, and the government moved that Petitioner be detained pretrial pursuant to 18 U.S.C. § 3142(e), which requires that a district *733court detain a criminal defendant pretrial if the court “finds that no condition or combination of conditions will reasonably assure the appearance of the person as required and the safety of any other person and the community.” After holding a detention hearing, the Pennsylvania district court found that Petitioner presented a risk of danger to his alleged interstate stalking victim, individuals against whom he had filed lawsuits, and possibly others and, thus, ordered that Petitioner be de-' tained pending trial.

Soon thereafter, Petitioner’s counsel moved the court to order an examination of Petitioner’s “competence to understand the nature and consequences of the charges pending against him and to effectively participate in his defense.” J.A. 94. The Pennsylvania district court granted the motion, and on October 9, 2015, ordered that Petitioner be “committed to the custody of the Attorney General for the conduct of’ a psychiatric or psychological examination and the preparation of a report setting forth findings from that examination, citing 18 U.S.C, §§ 4241 and 4247. J.A. 96. The Pennsylvania district court conducted its first competency hearing on December 30, 2015, and, based on evidence adduced during that hearing, ordered that Petitioner undergo further examination.

On April 22, 2016, the Pennsylvania district court again concluded that there was “reasonable cause to believe that [Petitioner] may presently be suffering from a mental disease or defect rendering him mentally incompetent to the extent that he is unable to understand the nature and consequences of the proceedings against him or to assist properly in his defense.” J.A. 133 (internal quotation marks omitted) (quoting 18 U.S.C. § 4241(a)). As a result, the court ordered Petitioner to undergo additional evaluation while remaining in the custody of the Attorney General pursuant to 18 U.S.C. § 4241. The court also ordered that Petitioner be transferred to Federal Medical Center Butner (“But-ner”) in Butner, North Carolina, to undergo such further evaluations and examinations. In the same order, the Pennsylvania district court also reaffirmed its finding that Petitioner “poses a danger (both economic and physical) to the community and others in it if released before trial” and found that Petitioner presented “a genuine and very real flight risk.” J.A. 133. Accordingly, the court found an additional, independent basis for Petitioner’s detention and ordered that Petitioner “remain in custody and ... not be released on bond,” J.A. 133, consistent with the requirements of 18 U.S.C. § 3142(e). Pursuant to the Pennsylvania district court’s order, the Féderal Bureau of Prisons transferred Petitioner to Butner on May 18, 2016.

On July 1, 2016, during his confinement at Butner, Petitioner filed a document titled “Indictment Complaint; and Petition for a Writ of Mandamus 28 USC 1361; and Motion to Disclose Electronic Surveillance 50 USC 1806(f)” in the United States District Court for the Eastern District of North Carolina (the “district court”). J,A. 5. The petition named several defendants, including the FBI and former Director James Comey; the CIA and former Director John Brennan; and former Attorney General Loretta Lynch. In the petition, Petitioner recited several “counts” against the named defendants, claiming that these defendants unlawfully surveilled Petitioner without his consent; misappropriated public funds by requiring Petitioner to undergo mental health evaluations that they knew or had reason to know Petitioner did not need; and traveled in interstate commerce with the intent to harass and intimidate Petitioner by placing him under unlawful surveillance. The petition requested two forms of relief. First, the petition asked the district court “to compel the *734U.S. Attorney for this district to perform their official duty” and “to present evidence against the [named defendants] related to the charges above” in an eviden-tiary hearing. J.A. 5. Second, the petition requested that the government disclose all electronic surveillance related to Petitioner. In addition to filing the petition, Petitioner also sought leave to proceed in for-ma pauperis.

Because Petitioner applied to proceed in forma pauperis, the district court undertook a frivolity determination pursuant to 28 U.S.C. § 1915(e)(2), a subsection of the in forma-pauperis statute that requires the court to “dismiss the case at any time if the court determines that ... the action ... is frivolous or malicious; fails to state a claim on which relief may be granted; or seeks monetary relief against a defendant who is immune from such relief.” Additionally, the court discussed Section 1915(g)— the three-strikes rule—and its application to Petitioner’s case. In particular, the district court incorrectly stated that the three-strikes rule allows a court to dismiss a prisoner’s civil action if the prisoner previously has had three or more prior actions or appeals, filed while the prisoner was “incarcerated or detained in any facility,” 28 U.S.C. § 1915(g), dismissed as frivolous or malicious or for failure to state a claim.2

The district court then concluded that Petitioner, a “frequent filer” in the federal courts, fell “within the three strikes provision” and did not allege any imminent danger that would warrant excepting him from that provision’s application. J.A. Ills. Accordingly, the district court denied Petitioner’s application to proceed in forma pauperis. And, based on its misunderstanding of Section 1915(g)’s operation, the court dismissed Petitioner’s action without prejudice, citing Section 1915(g) for support. Petitioner later filed a motion for reconsideration, which the district court denied. Still detained at Butner, Petitioner timely appealed the district court’s dismissal of his petition, as well as its denial of his application to proceed in forma pau-peris. Petitioner then sought leave to proceed in forma pauperis on appeal.

In sum, Petitioner was detained pursuant to 18 U.S.C. 8 3142(e) *and*18 U.S.C. § 4241 at the time he filed (1) the underlying petition; (2) the notice of appeal; and (3) the application to proceed in forma pauperis before this Court. *See United States v. Banks,*No. 2:15-cr-00168-MRH-1, ECF No. 349 (W.D. Pa. May 10, 2017) (regarding Petitioner’s continued detention pursuant to 18 U.S.C. § 3142(e)); *id.*ECF No. 361 (W.D. Pa. May 31, 2017) (regarding Petitioner’s continued detention pursuant to 18 U.S.C. § 4241).

II.

28 U.S.C. § 1915 governs applications to proceed in forma pauperis, including applications filed by prisoners. The Prison Litigation Reform Act of 1995 (“PLRA”) significantly amended the application of the in forma pauperis statute to federal prisoners by adding the three-strikes rule. This rule provides that “[i]n no event shall a prison*735er bring a civil action or appeal a judgment in a civil action or proceeding under this section if the prisoner has, on 3 or more prior occasions, while incarcerated or detained in any facility, brought an action or appeal in a court of the United States that was dismissed on the grounds that it is frivolous, malicious, or fails to state a claim upon which relief may be granted, unless the prisoner is under imminent danger of serious physical injury.” 28 U.S.C. § 1915(g). The question now before this Court is whether Section 1915(g) bars Petitioner’s application to proceed in forma pauperis on appeal.

Petitioner argues that his application is not barred by Section 1915(g) for two reasons: (1) he is not a “prisoner” as Section 1915 defines that term; and (2) his petition for writ of mandamus pursuant to 28 U.S.C. § 1361 is neither a “civil action” nor an “appeal [from] a judgment in a civil action or proceeding” subject to Section 1915(g).3 We reject both arguments.

A.

Petitioner first argues that he is not a “prisoner” and, therefore, that the three-strikes rule cannot preclude him from proceeding in forma pauperis on appeal. For purposes of Section 1915(g), “the term ‘prisoner’ means any person incarcerated or detained in any facility who is accused of, convicted of, [or] sentenced for ... violations of criminal law.” 28 U.S.C. § 1915(h). Accordingly, we must decide whether, at the relevant times, Petitioner was “incarcerated or detained in any facility,” *id.,*as “the result of a violation of criminal law,” *Michau v. Charleston County,*434 F.3d 725, 727 (4th Cir. 2006).

Although Petitioner acknowledges that “ordinary pretrial detainees who have been charged with, but not yet convicted of or sentenced for, crimes” are “prisoners” within the meaning of Section 1915(h), he asserts that he' “is not an ordinary pretrial detainee but a person in federal custody under the civil-commitment program for the mentally ill,” citing his confinement pursuant to 18 U.S.C. § 4241. Pet’r’s Opening Br. at 17-18. The Pennsylvania district court, however, originally detained Petitioner not based on cause to believe that Petitioner may have been incompetent to stand trial under 18 U.S.C. § 4241, but based on its finding that Petitioner presented a threat to the safety of certain individuals in the community, requiring that Petitioner be detained pretrial pursuant to 18 U.S.C. § 3142(e). As recently as April 22, 2016, the Pennsylvania district court concluded that Petitioner continues to merit pretrial detention under Section 3142(e) because he “poses a danger (both economic and physical) to the community and others in it if released before trial” and because “he would be a genuine and very real flight risk” if released prior to trial on his pending criminal charges. J.A. 133.

Accordingly, at the time Petitioner filed the petition and at the time he filed his notice of appeal and application to proceed *736in forma pauperis before this Court, Petitioner was detained on two, independent bases: (1) to undergo competency evaluations to “determine whether there is a substantial probability that in the foreseeable future he will attain the capacity to permit the [criminal] proceedings to go forward,” 18 U.S.C. § 4241(d)(1); and (2) to “reasonably assure [his] appearance ... and the safety of any ... person and the community,” *id.*§ 3142(e)(1). Because of this dual basis for Petitioner’s detention, at all relevant times Petitioner was detained pending trial on the criminal charges against him pursuant to 18 U.S.C. § 3142(e)—the statute governing “ordinary pretrial detainees who have been charged with, but not yet convicted of or sentenced for, crimes.” Pet’r’s Opening Br. at 18. In other words, Petitioner was at all relevant times a “person incarcerated or detained in any facility who [wa]s accused of ... violations of criminal law.” 28 U.S.C. § 1915(h). Thus, Petitioner falls squarely within Section 1915(h)’s definition of a “prisoner.” *See Kalinowski v. Bond,*358 F.3d 978, 979 (7th Cir. 2004) (“Pretrial detainees are ‘prisoners’ for purposes of the PLRA because they are in custody while ‘accused of ... violations of criminal law.’” (quoting 28 U.S.C. § 1915(h))). Therefore, we reject Petitioner’s contention that he is not a “prisoner” as defined in Section 1915(h).4

B.

Petitioner also argues that Section 1915(g) does not apply to him because his petition was a petition for writ of mandamus, not a “civil action,” and his pending appeal is, accordingly, not an “appeal [from] a judgment in a civil action.”528 U.S.C. § 1915(g). According to Petitioner, petitions for writs of mandamus are, categorically, not “civil actions” and, therefore, are not subject to the three-strikes rule.

Federal courts’ power to issue writs of mandamus springs . from two statutory sources. First, the All Writs Act, 28 U.S.C. *737§ 1651, authorizes federal courts of appeals to “issue all writs necessary or appropriate in aid of their respective jurisdictions and agreeable to the usages and principles of law.”6 28 U.S.C.§ 1651(a). A writ of mandamus issued pursuant to Section 1651 is an “extraordinary remedy” and “has traditionally been used in the federal courts only ‘to confine an inferior court to a lawful exercise of its prescribed jurisdiction or to compel it to exercise its authority when it is its ■ duty to do so.’ ” *Will v. United States,*389 U.S. 90, 95, 88 5.Ct. 269, 19 L.Ed.2d 305 (1967) (quoting *Roche v. Evaporated Milk Ass’n,*319 U.S. 21, 26, 63 S.Ct. 938, 87 L.Ed. 1185 (1943)). Second, 28 U.S.C. § 1361 accords to federal district courts “original jurisdiction of any action in the nature of mandamus to compel an officer or employee of the United States or any agency thereof to perform a duty owed to the plaintiff.” Writs of mandamus issued pursuant to Section 1361 are “intended to provide a remedy for a plaintiff only if he has exhausted all other avenues of relief and only if the defendant owes him a clear nondiscretionary duty.” *Heckler v. Ringer,*466 U.S. 602, 616-17, 104 S.Ct. 2013, 80 L.Ed.2d 622 (1984).

In support of the argument that his petition—which seeks relief pursuant to Section 1361—is not a “civil action” within the meaning of Section 1915(g), Petitioner relies on several out-of-circuit cases holding that certain petitions for writs of mandamus filed pursuant to Section 1651 are not “civil actions” and, thus, are not subject to Section 1915(g). Petitioner principally relies on *Madden v. Myers,*102 F.3d 74 (3d Cir. 1996), *superseded in part by*3d Cir. R. 24.1(c), a case in which the Third Circuit considered “whether the filing fee payment requirements of the [in forma pauperis statute] apply to mandamus petitions” filed by prisoners. 102 F.3d at 76. In *Madden,*the petitioner sought a Section 1651 writ of mandamus compelling the district court to act promptly on his petition for habeas corpus relief. *Id.*

The *Madden*Court found that a writ of mandamus “is not an ‘action,’ and, *a fortio-ri,*not a ‘civil action.’” *Id.*Instead, the court concluded that a Section 1651 writ of mandamus is “a procedural mechanism through which a court of appeals reviews a carefully circumscribed and discrete category of district court orders,” *id.*at 77, observing that the writ “has traditionally been available to a court of appeals only ‘to confine an inferior court to a lawful exercise of its prescribed jurisdiction or to compel it to exercise its authority when it is its duty to do so,’ ” *id.*at 77 n.3 (quoting *Will,*389 U.S. at 95, 88 S.Ct. 269). The *Madden*Court also concluded that a writ of mandamus is not an “appeal”—that is, an “appeal of a civil action”—but “is different in kind from an appeal” and, in fact, “may not issue if a petitioner can obtain relief by appeal.” *Id.*at 77.

Because it found that a writ of mandamus did not fall within the plain meaning of either a “civil action” or an “appeal” as those terms are used in Section 1915, the court concluded that its decision was “not *738controlled by the plain meaning of the text.” *Id.*Accordingly, the court moved on to determining whether treating a petition for writ of mandamus as a “civil action” would further or, alternatively, “frustrate[ ] congressional intent.” *Id.*The-*Madden*Court explained that “[t]he clear import of the PLRA is to curtail frivolous prison litigation, namely that brought under 42 U.S.C. § 1983 and the Federal Torts Claims Act.” *Id.*(citing H.R. Conf, Rep. No. 104-378, 104th Cong., 2d Sess. (1996)). The court described Section 1651 writs of mandamus as securing types of relief that are fundamentally different from the kinds of relief afforded pursuant to causes of action that are subject to the PLRA. In particular, the court stated that the writ provides relief “for prisoners who may have no other relief in a criminal action in which a court has exceeded its judicial power or failed to use its power where there is a duty to do so.” *Id.*(internal quotation marks omitted). And, additionally, the court described Section 1651 petitions as “often the only way a litigant can obtain review of certain orders or can compel a district judge to act,” *e.g.,*when the district court has “unduly delayed” proceedings in the petitioner’s case or when the district judge has “refus[ed] to recuse ... [and] the judge’s impartiality might reasonably be questioned.” *Id.*at 78. Concluding, then, that Section 1651 petitions are not representative of the type of “frivolous prison litigation” Congress intended to curtail through the PLRA, the Third Circuit held that “where the underlying litigation is criminal, or otherwise of the type that Congress did not intend to curtail, the petition for mandamus need not comply with the PLRA.” *Id.*at 77.

Other courts have reached similar conclusions regarding whether Section 1651 petitions for writs of mandamus are subject to the PLRA. *See In re Stone,*118 F.3d 1032, 1034 *&*n.2 (5th Cir. 1997) (holding that, “[i]n a mandamus proceeding, ... the nature of the underlying action will determine the applicability of the PLRA,” such that petitions filed in underlying *civil*proceedings are “civil actions” but those filed in underlying *criminal*proceedings are not); *Martin v. United States,*96 F.3d 853, 854-55 (7th Cir. 1996) (Posner, C.J.) (finding that, although Section 1651 petitions arising from underlying *civil*litigation are “civil actions,” petitions arising from *criminal*proceedings are “not a form of prisoner litigation” that Congress intended to curtail and, thus, are not “civil actions”); *In re Nagy,*89 F.3d 115, 117 & n.1 (2d Cir. 1996) (holding that “if a prisoner seeks a writ of mandamus directed to a judge conducting a criminal trial, the application is not within the category of lawsuits to which the PLRA was aimed” and is not a “civil action” subject to the PLRA, but noting that a petition arising from *civil*proceedings may be a “civil action” if it is “an alternative device for obtaining the relief sought in civil actions that are covered by the PLRA”). *But see Green v. Nottingham,*90 F.3d 415, 418 (10th Cir. 1996) (holding that “petitions for a writ of mandamus are included within the meaning of the term ‘civil action’ as used in § 1915”). Similarly, the Fourth Circuit has adopted a rule requiring only prisoners who file a petition for writ of mandamus “in a matter arising out of a *civil*case” to comply with Section 1915’s requirement that prisoners proceeding in forma pauper-is pay filing fees in full. 4th Cir. R. 21(e)(1), (3) (emphasis added); *see also*28 U.S.C. § 1915(b)(1).

Petitioner argues that his petition for writ of mandamus, filed pursuant to Section 1361 rather than Section 1651, falls outside the definition of a “civil action” and, thus, that Section 1915(g) does not bar him from proceeding in forma pauperis on appeal. No circuit court has squarely *739addressed, in a published opinion, whether petitions for writs of mandamus filed pursuant to Section 1361 are, or are not, “civil actions” within the meaning of Section 1915.7 Nor do we resolve that question in this case. Instead, we assume, "without deciding, that Section 1361 and Section 1651 petitions are treated equivalently for purposes of Section 1915. Applying this assumption, certain Section 1361 petitions would fall squarely within the definition of a “civil action” for purposes of Section 1915—such as petitions that serve merely as “alternative devicefs] for obtaining the relief sought in civil actions that are covered by the PLRA,” *In re Nagy,*89 F.3d at 117 n.1—while other Section 1361 petitions would not be “civil actions” subject to the three-strikes rule—such as petitions that seek relief in preexisting criminal proceedings, *see id.*at 117; *Martin,*96 F.3d at 854.

Petitioner attempts to characterize his Section 1361 petition as seeking relief in his preexisting criminal proceedings before the Western District of Pennsylvania and, thus, as falling outside the definition of a “civil action.” In particular, Petitioner’s counsel suggests that Petitioner “may have harbored concern about his speedy-trial rights” and “may have also felt that his mental-competency proceedings were unjustly drawn out.” Pet’r’s Opening Br. at 32. Based on these conjectures, Petitioner’s counsel argues that we should read Petitioner’s Section 1361 petition as seeking to compel the Pennsylvania district court to act on the criminal charges pending against Petitioner in that district or, similarly, to move forward with Petitioner’s competency proceedings in that district. But no fair reading of the petition supports this characterization.8 Indeed, rather than seeking relief in Petitioner’s criminal proceedings before the Pennsylvania district court, the petition in question seeks to compel the institution of *new*proceedings by requesting that a grand jury be empaneled to investigate Petitioner’s separate allegations against a group of government officials and, additionally, to initiate *separate*proceedings for disclbsure of certain electronic surveillance allegedly related to Petitioner.

As such, even assuming that Section 1361 petitions seeking relief in preexisting criminal proceedings are, like their Section 1651 counterparts, not “civil actions” for purposes of the PLRA, Petitioner’s Section 1361 petition does not benefit from this principle. Accordingly, we conclude that Petitioner’s Section 1361 petition is a “civil action” within the meaning of Section 1915(g) and, thus, that Petitioner is barred from proceeding in forma pauperis on appeal by operation of the three-strikes rule.

III.

For the reasons set forth herein, we conclude that Petitioner is barred from proceeding in forma pauperis on appeal by *740operation of Section 1915(g). Accordingly, we deny Petitioner’s application to proceed in forma pauperis.

*APPLICATION DENIED*

1

. The government later procured a superseding indictment further charging Petitioner with wire fraud, aggravated identity theft, and making false statements.

2

. Notably, Section 1915(g) is not a basis for dismissing a claim. On the contrary, Section 1915(g) operates only to bar certain specified prisoners from proceeding in forma pauperis. 28 U.S.C, § 1915(g) (barring three-strikers from ''bringing] a civil action or appealing] a judgment in a civil action or proceeding *under this section"*(emphasis added)); *id.*§ 1915 (governing "[p]roceedings in forma pauperis”); *see also Blakely v. Wards,*738 F.3d 607, 609 (4th Cir. 2013) (en banc) (explaining that a "prisoner generally may not proceed in forma pauperis but rather must pay up-front all filing fees for his subsequent suits” when the prisoner "has already had three cases dismissed as frivolous, malicious, or for failure to state a claim for which relief may be granted”).

3

. Petitioner does not dispute that—if the three-strikes rule otherwise applies—he is barred from proceeding in forma pauperis because he previously has filed numerous claims "while incarcerated or detained,” 28 U.S.C. § 1915(g), that have been dismissed as frivolous or malicious or for failing to state a claim on which relief may be granted, *see Banks v. U.S. Marshal,*274 Fed.Appx. 631, 635 (10th Cir. 2008) (assessing Petitioner four strikes); *Banks v. County of Allegheny,*568 F.Supp.2d 579, 586 n.1 (W.D. Pa. 2008) (adopting magistrate's report and recommendation, which explained that Petitioner "has accumulated many more than three strikes”). Nor does Petitioner argue that he "is under imminent danger of serious physical injury,” 28 U.S.C. § 1915(g), such that the statutory exception to the three-strikes rule should apply-

4

. We note, however, that if the basis for Petitioner’s detention changes, Petitioner may not qualify as a "prisoner” for purposes of Section 1915(g), For instance, if the Pennsylvania district court were to determine that Petitioner’s "mental condition has not so improved as to permit the proceedings to go forward,” 18 U.S.C, § 4241(d), and to civilly commit Petitioner pursuant to the procedures set forth in 18 U.S.C. § 4246, Petitioner would no longer be detained as "the result of a violation of criminal law,” *Michau,*434 F.3d at 727. Instead, Petitioner would be detained as the result of a determination that he "is presently suffering from a mental disease or defect as a result of which his release would create a substantial risk of bodily injury to another person or serious damage to property of another.” 18 U.S.C. § 4246(d). In such circumstances, Petitioner would not be a "prisoner” for purposes of the in forma pauperis statute. *Cf. Kolocotronis v. Morgan,*247 F.3d 726, 728 (8th Cir. 2001) (holding that an inmate detained at a mental health facility after being found not guilty by reason of insanity was a patient receiving mental health treatment and was not a "prisoner” under Section 1915(h)); *Michau,*434 F.3d at 727-28 (holding that an individual detained under the South Carolina Sexually Violent Predator Act was not a "prisoner” within the meaning of Section 1915(h) because he was detained pursuant to a non-punitive, civil detention statute).

5

. In the alternative, Petitioner asserts that his petition sought habeas corpus relief by requesting that the government "release him from federal custody.” Pet’r’s Opening Br. at 34-35. No fair reading of the petition supports this argument. This is particularly true given that Petitioner has demonstrated an ability to request his release from custody should he desire to do so. *See, e.g., In re Banks,*674 Fed.Appx. 238, 239 (3d Cir. 2017) (summarizing a petition in which Petitioner alleged that the Pennsylvania district court judge was “keeping him committed for an unreasonable period of time” and sought "an order ... directing the Respondents to ... release him from custody”). Accordingly, we decline to consider this argument.

6

. Federal Rule of Civil Procedure 81(b) abolished the common law writ of mandamus, precluding federal district courts from issuing writs of mandamus under Section 1651. *See*12 Charles Alan Wright & Arthur R. Miller, Federal Practice & Procedure § 3134 (3d ed. 2014). Rule 81(b) has no effect on appellate courts' power to issue writs of mandamus pursuant to Section 1651. Id.; see *also Armour & Co. v. Kloeb,*109 F.2d 72, 74 (6th Cir. 1939) (stating that Rule 81(b) "cannot be construed to apply to Circuit Courts of Appeals, since so construed it would be in the exercise of a power not conferred upon the Supreme Court"), *judgment rev'd on other grounds by Kloeb v. Armour & Co.,*311 U.S. 199, 61 S.Ct. 213, 85 L.Ed. 124 (1940). And despite Rule 81(b), Congress has granted district courts original jurisdiction over certain "action[s] in the nature of mandamus.” 28 U.S.C. § 1361.

7

. The Third Circuit has noted, however, that "the same considerations” that govern the determination of whether a Section 1651 petition is a “civil action” within the meaning of the PLRA "may apply” when determining whether a petition for writ of mandamus filed pursuant to Section 1361 is a "civil action” for purposes of the PLRA. *Madden,*102 F.3d at 76 n.2.

8

. This is especially true given that Petitioner previously has filed a mandamus petition seeking to compel just such action in the Pennsylvania district court, *See, e.g., In re Banks,*674 Fed.Appx. at 239 (summarizing a petition in which Petitioner alleged that the Pennsylvania district court judge was "vio-lat[ing] his right to a speedy trial” and "keeping him committed for an unreasonable period of time” and sought “an order ,,. directing the Respondents to perform their duties”).