Reversed and vacated by published opinion. Judge NIEMEYER wrote the opinion, in which Judge MICHAEL and Judge MOON joined.
OPINION
The question in this appeal is whether the Equal Access to Justice Act (the “EAJA”), 28 U.S.C. § 2412, contains an unequivocal expression of congressional intent to waive sovereign immunity to authorize the assessment of an award of attorneys fees against the United States in a habeas corpus proceeding. The EAJA provides that a court shall award reasonable attorneys fees to a prevailing party (other than the United States) “in any civil action (other than eаses sounding in tort), including proceedings for judicial review or agency action, brought by or against the United States ... unless the court finds that the position of the United States was substantially justified.” 28 U.S.C. § 2412(d)(1)(A) (emphasis added). Applying this provision, the district court entered an order awarding Joseph P. O’Brien $35,935 in attorneys fees incurred in connection with his successful prosecution of a petition for a writ of habeas corpus, which he filed against the Federal Bureau of Prisons under 28 U.S.C. § 2241.
Appealing the district court’s order, the governmеnt contends that Congress did not waive sovereign immunity as to such an award because, in waiving sovereign immunity as to an award of attorneys fees to a prevailing party in a “civil action,” Congress did not unequivocally express an intent to waive sovereign immunity as to an award of attorneys fees to a prevailing party in a habeas corpus proceeding. The government also contends that its position in this habeas corpus proceeding was “substantially justified.”
*501 Because the EAJA does not expressly authorize an award of attorneys fees to a prevailing party in a habeas corpus proceeding and because the term “civil action” does not unambiguously encompass habeas actions, we conclude that the EAJA does not contain the unequivocal expression of congressional intent necessary to amount to a waiver of sovereign immunity and thereby permit the assessment of attorneys fees against the United States in a habeas corpus proceeding. Accordingly, we reverse and vacаte the district court’s order without reaching the government’s argument that its litigating position was “substantially justified.”
I
After Joseph O’Brien pleaded guilty to bank fraud in the Eastern District of Pennsylvania, the district judge sentenced him, on February 13, 2002, to 24 months’ imprisonment and recommended that, when he became eligible, O’Brien be designated to serve his sentence at the McLeod Community Corrections Center, a halfway house in Charlotte, North Carolina. Instead of sending O’Brien to prison, the Federal Bureau of Prisons designated O’Brien to serve his entire sentence at the McLeod Center.
On December 13, 2002, the Office of Legal Counsel of the United States Department of Justice rendered a “Memorandum Opinion for the Deputy Attorney General,” which concluded that the Bureau of Prisons’ practice of placing offenders sentenced to specified prison sentences in halfway houses at the outset of their sentence or transferring them from prisons to halfway houses at any time the Bureau of Prisons chose was unlawful under the U.S. Sentencing Guidelines and under 18 U.S.C. §§ 3621 and 3622. The opinion applied to offenders sentenced to terms of imprisonment within either Zone C of the Sentencing Guidelines’ sentencing table (providing for 8 to 16 months’ imprisonment) or Zone D (providing for 12 months’ to life imprisonment).
Consistent with the Justice Department’s position, O’Brien was notified on December 23, 2002, that he would be re-designated to serve the remainder of his sentence in a federal prison. In January 2003, he was formally redesignated to a federal prison camp, to be transferred there on or about January 27, 2003.
O’Brien and three other inmates commenced this habeas action on January 21, 2003, by filing a “Joint Petition for a Writ of Habeas Corpus under 28 U.S.C. § 2241 by Prisoners in Federal Custody.” They requested a temporary restraining order, pending a hearing on their motion for a preliminary injunction, that they not be transferred from the McLeod Center to a federal prison camp. Following oral argument, the district court issued a temporary restraining order on January 23, 2003, to expire on February 4, 2003. Thе court also scheduled a hearing on that date on the motion for a preliminary injunction. When O’Brien filed a motion before the scheduled hearing date to postpone the hearing until February 14, 2003, the district court, over the government’s objection, extended the temporary restraining order until that date. The court also rescheduled the hearing on the motion for a preliminary injunction to take place on that same date. Shortly before the newly scheduled hearing date, when O’Brien had nоt yet filed his memorandum of law in support of his motion for a preliminary injunction, the district court, sua sponte, extended the temporary restraining order a second time, until March 5, 2003. In its order, the court ruled that the ten-day limit imposed by Federal Rule of Civil Procedure 65(b) did not apply because the temporary restraining order “was entered with notice.”
*502 The government moved to dissolve the second extension of the temporary restraining order, arguing that the district court was without authority to extend the temporary restraining order bеyond 20 days. In support of its position, the government cited three cases and a passage from Wright & Miller’s Federal Practice and Procedure, which states that “20 days ... is the longest that a temporary restraining order can be operative.” 11A Charles Alan Wright, Arthur R. Miller, & Mary Kay Kane, Federal Practice and Procedure § 2953 (2d ed.1995). In response to this motion, the court scheduled a hearing on February 20, 2003, following which it entered an order dated March 6, 2003, granting O’Brien’s “motion for stay” of any redesignation or transfer (which was made and orally granted at the February 20 hearing) and his motion for a preliminary injunction.
. During the February 20 heаring, the district court stated that it thought the government had misrepresented the law when arguing that there was a 20-day time limit for temporary restraining orders:
You’ve misrepresented the import of the cases to the Court. You’ve overstated it and you’ve done so in a way that in a civil case, if the other side moved for sanctions, I would have to seriously consider it.
I think the case law is clear in the Fourth Circuit that only a temporary restraining order issued for an indeterminate period of time becomes willy-nilly a preliminary injunction.
The court then received argument from the parties on the merits of the habeas petition.
On May 20, 2003, the government mooted O’Brien’s habeas petition and agreed that he would not be redesignated to a federal prison camp, but would continue to serve the remainder of his sentence, which was scheduled to expire in February 2004, at the McLeod Center. The district court confirmed the government’s agreement in an order dated June 30, 2003.
Having thus prevailed on his habeas petitiоn, O’Brien moved the district court for an award of attorneys fees and costs pursuant to the EAJA, 28 U.S.C. § 2412, arguing that the government’s position in the litigation was “not substantially justified.” The government opposed this motion, alleging that its position on the proper facility in which to serve a sentence of imprisonment of over 12 months was substantially justified, based on a series of successes in similar cases in other federal courts. While the district court recognized the government’s other successes, it concluded that they were merely one factor that the court should consider in deciding whether to make an award under the EAJA. Noting that it was also to consider the reasonableness of the government’s “stance” in the litigation, the court referred to the government’s position with respect to the viability of a temporary restraining order beyond 20 days, noting:
For instance, in the hearing for the preliminary injunction in this matter, this Court considered imposing sanctions on [the government] for [its] clearly erroneous representations of the law.
The court concluded:
Therefore, in the totality of the circumstances, tak[ing] into account objective indicia of substantial justification, such as the alleged “string of successes” as well as the specific facts of the instant litigation, the Court finds that the government was not substantially justified in the position it took in this specific case. Furthermore, and in the alternative, based on the stances taken by respondents in the hearing, as well as their pleadings to this Court, the Court *503 finds that respondent has undermined any substantial justificаtion that might have existed.
The court then awarded O’Brien attorneys fees, costs, and expenses under the EAJA in the amount of $35,934.66.
The government filed a motion for reconsideration, raising for the first time the issue of sovereign immunity and arguing that under the EAJA the United States waived its sovereign immunity only with respect to attorneys fees in “civil actions” and that a habeas corpus proceeding was not a “civil action” for purposes of the EAJA. The district court rejected the government’s argument, and, distinguishing circuit court cаses that had concluded that a habeas proceeding was not a “civil action” for purposes of the EAJA, the court stated that “Petitioner O’Brien’s ‘claim was not merely a vindication of his own personal rights, but a challenge to a regulatory policy that had a sweeping effect on’ a large class of actual and potential inmates” (quoting
In re Hill,
From the district court’s order, the government filed this appeal, contending (1) that O’Brien’s habeas action was not a “civil action” with respect to which the United States waived its sovereign immunity through the EAJA, and (2) that the government’s position in this litigation was, in any event, “substantially justified,” precluding an award of attorneys' fees to O’Brien.
II
It is well-settled that “[a]ttorneys’ fees may be assessed against the United States
only when
it has waived its sovereign immunity by statute.”
United States v. Dawkins,
Accordingly, in deciding whether, through the EAJA, Congress waived the government’s sovereign immunity for an award of attorneys fees in habeas actions, “[o]ur task is to discern the ‘unequivocally expressed’ intent of Congress, construing ambiguities in favor of immunity.”
United States v. Williams,
O’Brien contends that the district court correctly determined that his habeas corpus petition was a “civil action” for purposes of the EAJA. Following the rationale of the district court, O’Brien notes that the *504 EAJA includes within the scope of the term “civil action” аny “proceedings for judicial review of agency action,” 28 U.S.C. § 2412(d)(1)(A), and he argues that his habeas corpus petition was such a proceeding to review agency action “regardless of the procedural vehicle used to present the claim.” Thus, O’Brien contends that despite the fact that his action was styled as a petition for a writ of habeas corpus, it was in fact directed at challenging the Bureau of Prisons’ policy, and as such, it was a “civil action” for purposes of the EAJA. For authority, O’Brien relies principally on language from the Ninth Circuit’s opinion in In re Hill, which notes:
[W]e must look to the substance of the remedy sought, not the labels attached to the claim, in determining whether a proceeding falls within the term “any civil action” of the EAJA. In contrast to the challenge of unlawful criminal custody in Boudin [v. Thomas,732 F.2d 1107 (2d Cir.1984)], Hill sought to gain admission into this country and, in essence, sought to secure a declaratory judgment that the Government’s policy of excluding homosexual aliens without a medical certificate was improper. Hill’s claim was not merely a vindication of his own personal rights, but a challenge to a regulatory policy that had a sweeping effect on homosexual aliens seeking to enter the United States.
At the outset, we point out that the EAJA does not provide a definition of the term “civil action,” and its terms do not explicitly include or exclude habeas corpus proceedings. O’Brien’s success, therefore, depends on whether “civil action,” as used in the EAJA, unequivocally or unambiguously includes а habeas proceeding.
We begin by recognizing that courts have, for a long time, categorized habeas cases as “civil” in nature.
See, e.g., Hilton v. Braunskill,
The appropriate classification of habeas actions becomes even more ambiguous when habeas’ characteristics are closely reviewed against the characteristics of, and distinctions between, civil and criminal actions, which are themselves not clear.
See Browning-Ferris Indus. of Vt., Inc. v. Kelco Disposal, Inc.,
The habeas corpus proceeding is specifically designed to protect individual liberty and redress unlawful- detention.“[T]he essence of habeas corpus is an attack by a person in custody upon the legality of that custody, and ... the traditional function of the writ is to secure release from illegal custody.”
Preiser v. Rodriguez,
Because habeas aсtions have both criminal and civil aspects, courts have routinely regarded them as “hybrid” actions.
See, e.g., Sloan v. Pugh,
And because habeas actions have both a criminal and civil nature, when a *506 statutory provision regulates a “civil action,” we can only conclude that it does not necessarily follow that it also regulates a habeas proceeding. This approach is amply demonstrated by a line of cases in which courts have considered such statutory provisions.
For example, in
Schlanger v. Seamans,
In
Smith,
The PLRA does not define “civil action,” and does not explicitly include or exclude habeas litigants from its reach. Although a habeas proceeding is considered a civil action for some purposes, it is more accurately regarded as being sui generis.
In the same vein, the Supreme Court has repeatedly rejected the notion that simply because a habeas action is civil in nature, it must be treated as a civil action. Indeed, the Court has time and again highlighted the distinctions between the two types of actions.
Thus, in
Harris v. Nelson,
the Court held that the discovery rules in the Federal Rules of Civil Procedure, which are applicable in civil actions, did not apply to habeas proceedings. Focusing on Federal Rule of Civil Procedure 81(a)(2), which applies the civil rules to habeas proceedings to the extent that the practice in such proceedings “has heretofore conformed to the practice in civil actions,” the Court concluded that habeas practice in federal courts “has conformed with civil practice only in a general sense” and that such conformity did not include discovery as provided in the civil discovery rules.
Similarly, in
Browder v. Director, Illinois Department of Corrections,
Finally, in
O’Neal,
One problem with [the argument that the civil harmless error stаndard applies in the habeas context] lies in its failure to take into account the stakes involved in a habeas proceeding. Unlike the civil cases cited by the State, the errors being considered by a habeas court occurred in a criminal proceeding, and therefore, although habeas is a civil proceeding, someone’s custody, rather than mere civil liability, is at stake.
Id.
at 440,
Thus, even though a habeas action sometimes functions in'a manner similar to a civil action, the cirсumstances where it does not so function are sufficiently numerous to preclude the conclusion that when a “civil action” is regulated, the regulation necessarily includes a habeas action. Thus, in enacting the EAJA and authorizing that an award of attorneys fees may be assessed against the United States in “civil actions,” Congress did not expressly include habeas actions. More relevant to the analysis here,, using .the term “civil action” did not unequivocally or unambiguously include habeas actions, and рerhaps for good reason. The EAJA’s policy of leveling the playing field in civil litigation against the United States, particularly when the United States has taken a position that is not substantially justified,
see, e.g., Roanoke River Basin Ass’n v. Hudson,
In holding that “civil action” as used in the EAJA does not unequivocally and unambiguously include a habeas proceeding, we join similar holdings made by two other courts of appeals.
See Ewing v. Rodgers,
O’Brien argues that the term “civil action” as used in the EAJA includes “proceedings for judicial review of agency action,” and that his habeas action in this case was a proceeding to review agency action “regardless of the procedural vehicle used to present the claim.” Stated otherwise, O’Brien suggests that regardless of the fact that his action was styled as a “Joint Petition for a Writ of Habeas Corpus,” it was in fact directed at challenging an administrative policy. Accordingly, he argues, that it was a “civil action” for purposes of the EAJA.
This approach has been followed by some courts, but’ solely when the habeas corpus proceeding was filed in an immigration context.
See, e.g., Sotelo-Aquije v. Slattery,
*508
O’Brien’s case is a classic habeas action by a person in custody attacking “the legality of that custody.”
Preiser,
Moreover, to the extent that Sotelo-Aquije and Hill stand in tension with the holdings in Ewing and Boudin, we find Ewing and Boudin to be more persuasive. See also 1 Mary F. Derfner & Arthur D. Wolf, Court Awarded Attorney Fees ¶ 7.04[4], at 7-74 & n.89 (2004) (citing the Hill court’s inclusion of certain types of habeas corpus cases under the EAJA as an example of “spotty” adherence by the courts to the rule that waivers of sovereign immunity are to be strictly construed).
At bottom, one cannot reasonably conclude that the authorization for an award of attorneys fees in “civil actions,” as provided by the EAJA, includes an unequivocal expression of congressiоnal intent to authorize an award of attorneys fees to a prevailing party against the United States in a habeas proceeding. There are simply too many distinctions between habeas proceedings and civil proceedings to permit such a conclusion.
Because the EAJA’s waiver of sovereign immunity to awards of attorneys fees does not extend to habeas corpus proceedings, the award in this case against the United States is barred. Accordingly, we reverse and vacate the district court’s order making such an award.
REVERSED AND VACATED.
