Explainer
Habeas corpus explained: challenging detention in court
A habeas corpus petition asks a court to decide whether a person's custody is lawful; the Supreme Court has described habeas as the traditional means to seek release from unlawful detention.[1] The Constitution says the privilege of the writ shall not be suspended unless public safety requires it in cases of rebellion or invasion, and federal statutes set out who can grant it and on what grounds.[2][3][4]
This page explains the writ of habeas corpus, the constitutional clause that protects it and the main federal statutes, using statute text and Supreme Court opinions. It is general information, not legal advice; anyone in custody or helping someone in custody should talk to a lawyer or a public defender. Deadlines in habeas cases are strict.
Habeas corpus is a way to challenge detention in court: a petition asks a judge to decide whether a person’s custody is lawful.[1] Federal law makes the writ available, among other cases, to anyone held in violation of the Constitution, laws or treaties of the United States.[4]
If the government is holding someone, a habeas petition asks a judge: is this detention legal? The Supreme Court has said habeas has traditionally been a means to seek release from unlawful detention.[1]
Origins and the Suspension Clause
Concurring in DHS v. Thuraissigiam (2020), Justice Clarence Thomas wrote that by the end of the 16th century the English connected the common-law writ of habeas corpus to liberty, associating it with Magna Carta’s guarantee that no free person would be imprisoned except by the lawful judgment of their peers or the law of the land.[5]
The US Constitution mentions the writ once, in Article I, Section 9: “The privilege of the writ of habeas corpus shall not be suspended, unless when in cases of rebellion or invasion the public safety may require it.”[2] Federal statutes set out which courts can grant the writ and on what grounds.[3][4]
The federal habeas statutes
Three sections of the US Code do most of the work. One lets federal courts grant the writ in general. Another covers people held after a state court conviction. A third lets federal prisoners ask the court that sentenced them to correct the sentence.[3][6][7]
- 28 U.S.C. 2241. The Supreme Court, any justice, the district courts and any circuit judge may grant the writ within their jurisdictions.[3] It reaches, among others, people in federal custody and anyone held in violation of the Constitution, laws or treaties of the United States.[4]
- 28 U.S.C. 2254 (state prisoners). Federal courts hear an application from someone held under a state court judgment only on the ground that the custody violates federal law.[6] The applicant generally must first exhaust state remedies.[8] For claims the state court decided on the merits, relief requires a decision contrary to, or an unreasonable application of, clearly established Supreme Court law, or an unreasonable determination of the facts.[9]
- 28 U.S.C. 2244. A one-year limitation period applies to state prisoners’ applications.[10] Before filing a second or successive application, the applicant must ask the court of appeals for an order allowing the district court to consider it.[11]
- 28 U.S.C. 2255 (federal prisoners). A federal prisoner who claims the sentence violates the Constitution or federal law moves the sentencing court to vacate, set aside or correct it.[7]
The one-year limitation period was adopted in the Antiterrorism and Effective Death Penalty Act of 1996 (AEDPA).[11] The federal judiciary lists habeas corpus among the kinds of cases federal courts hear.[12] For how those courts are arranged, see how federal courts are organized.
Boumediene v. Bush: Guantanamo
Congress enacted the Detainee Treatment Act of 2005, and the Military Commissions Act of 2006 amended the habeas statute so that no court had jurisdiction over habeas applications by noncitizens detained by the United States and determined to have been properly detained as enemy combatants.[13] In Boumediene v. Bush (2008), the Supreme Court held that the Guantanamo detainees were entitled to the habeas privilege, and that because the review procedures Congress had provided were not an adequate substitute, section 7 of the Military Commissions Act “operates as an unconstitutional suspension of the writ.”[14]
The Court named at least three factors for deciding how far the Suspension Clause reaches: the detainees’ citizenship and status and how it was determined, the nature of the places where they were captured and held, and the practical obstacles to resolving their claims.[15] Justice Kennedy wrote for a five-justice majority; Chief Justice Roberts dissented, joined by Justices Scalia, Thomas and Alito.[16]
DHS v. Thuraissigiam: habeas and immigration
DHS v. Thuraissigiam (2020) involved a Sri Lankan national stopped 25 yards after crossing the southern border without inspection, who was detained for expedited removal.[17] The Court said the Suspension Clause at a minimum protects the writ as it existed in 1789, and that habeas has traditionally been a means to seek release from unlawful detention. Because he sought another chance to apply for asylum rather than release, his claim fell outside that scope.[18] The Court also rejected his due process claim, holding that for people seeking initial entry, decisions of officers acting within powers Congress has given them are due process of law.[19]
For the fast-track removal process at issue in Thuraissigiam, see the expedited removal expansion; for detention, see immigration detention explained. The broader constitutional guarantee of fair procedure is covered in due process explained. This page does not cover current proposals or statements about suspending the writ.
Read next
Courts and the law: a crash course
A sourced crash course on US courts and law: the Supreme Court, its 2026-27 term, federal rulemaking, Section 230, and the AI copyright and antitrust cases.
Questions readers ask
What is habeas corpus?
A habeas corpus petition asks a court to decide whether a person is being held lawfully. The Supreme Court has said habeas has traditionally been a means to seek release from unlawful detention.[1]
When can habeas corpus be suspended?
Article I, Section 9 of the Constitution says the privilege of the writ shall not be suspended unless, in cases of rebellion or invasion, the public safety may require it.[2]
Which courts can grant habeas corpus?
Under 28 U.S.C. 2241, the Supreme Court, any justice, the federal district courts and any circuit judge can grant the writ within their jurisdictions.[3]
Can a state prisoner go to federal court with a habeas petition?
Yes, but only on the ground that the custody violates the Constitution, laws or treaties of the United States. The prisoner generally must first exhaust state court remedies, file within a one-year limitation period, and show that the state court's decision was contrary to or an unreasonable application of clearly established Supreme Court law, or rested on an unreasonable view of the facts.[6][8][10][9]
Did Guantanamo detainees have a right to habeas corpus?
In Boumediene v. Bush (2008), the Supreme Court held that they were entitled to the habeas privilege and that section 7 of the Military Commissions Act operated as an unconstitutional suspension of the writ.[14]
Can habeas be used to challenge a removal decision?
In DHS v. Thuraissigiam (2020), the Court said the Suspension Clause protects at least the writ as it existed in 1789, a means to seek release from unlawful detention, and held that a request for another chance to apply for asylum fell outside it.[18]
Sources
· 19 claims from 4 publishers
Each numbered claim is a statement we checked against the sources listed with it. Tap a number in the text to see its sources in place.
- [1]
A habeas corpus petition asks a court to decide whether a person's custody is lawful; the Supreme Court has said habeas has traditionally been a means to seek release from unlawful detention. confirmedas of 2026-11-21
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
- 28 U.S.C. 2241, Power to grant writ · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [2]
Article I, Section 9 of the Constitution says the privilege of the writ of habeas corpus shall not be suspended unless public safety requires it in cases of rebellion or invasion. confirmedas of 2026-11-21
- Article I, U.S. Constitution · Cornell Law School Legal Information Institute (constitution text) · Primary source · Section 9 (retrieved 2026-11-21)
- [3]
Under 28 U.S.C. 2241, writs of habeas corpus may be granted by the Supreme Court, any justice, the district courts and any circuit judge within their respective jurisdictions. confirmedas of 2026-11-21
- 28 U.S.C. 2241, Power to grant writ · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [4]
Section 2241 makes the writ available, among other cases, to a person in federal custody and to a person in custody in violation of the Constitution, laws or treaties of the United States. confirmedas of 2026-11-21
- 28 U.S.C. 2241, Power to grant writ · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- 28 U.S.C. 2241, Power to grant writ · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [5]
Concurring in DHS v. Thuraissigiam (2020), Justice Thomas wrote that by the end of the 16th century the English connected the common-law writ of habeas corpus to liberty, associating it with Magna Carta's guarantee against imprisonment except by lawful judgment of one's peers or the law of the land. confirmedas of 2026-11-21
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 · Thomas, J., concurring (retrieved 2026-11-21)
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 · Thomas, J., concurring (retrieved 2026-11-21)
- [6]
Under 28 U.S.C. 2254, federal courts hear a habeas application from a person held under a state court judgment only on the ground that the custody violates the Constitution, laws or treaties of the United States. confirmedas of 2026-11-21
- 28 U.S.C. 2254, State custody; remedies in Federal courts · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [7]
A federal prisoner who claims the sentence was imposed in violation of the Constitution or federal law may move the court that imposed it to vacate, set aside or correct the sentence under 28 U.S.C. 2255. confirmedas of 2026-11-21
- 28 U.S.C. 2255, Federal custody; remedies on motion attacking sentence · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [8]
A state prisoner's federal habeas application generally cannot be granted unless the applicant has exhausted the remedies available in the state's courts. confirmedas of 2026-11-21
- 28 U.S.C. 2254, State custody; remedies in Federal courts · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [9]
For a claim a state court decided on the merits, federal habeas relief requires that the state decision was contrary to, or an unreasonable application of, clearly established federal law as determined by the Supreme Court, or rested on an unreasonable determination of the facts. confirmedas of 2026-11-21
- 28 U.S.C. 2254, State custody; remedies in Federal courts · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- 28 U.S.C. 2254, State custody; remedies in Federal courts · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [10]
A one-year limitation period applies to a habeas application by a person held under a state court judgment. confirmedas of 2026-11-21
- 28 U.S.C. 2244, Finality of determination · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [11]
The one-year limitation period for state prisoners' federal habeas petitions was adopted in the Antiterrorism and Effective Death Penalty Act of 1996 (AEDPA); under 28 U.S.C. 2244, a second or successive application first needs an order from the court of appeals authorising the district court to consider it. confirmedas of 2026-11-21
- 28 U.S.C. 2254, State custody; remedies in Federal courts · US Government Publishing Office (govinfo, United States Code) · Primary source · Rules Governing Section 2254 Cases, committee notes (retrieved 2026-11-21)
- 28 U.S.C. 2244, Finality of determination · US Government Publishing Office (govinfo, United States Code) · Primary source (retrieved 2026-11-21)
- [12]
The federal judiciary lists habeas corpus issues among the types of cases heard in the federal court system. confirmedas of 2026-11-21
- Comparing Federal & State Courts · Administrative Office of the US Courts · Primary source · Types of Cases Heard, federal court system (retrieved 2026-11-21)
- [13]
As described in Boumediene v. Bush, Congress enacted the Detainee Treatment Act of 2005, and the Military Commissions Act of 2006 amended the habeas statute so that no court had jurisdiction over habeas applications by aliens detained by the United States and determined to have been properly detained as enemy combatants. confirmedas of 2026-11-22
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, introduction (retrieved 2026-11-22)
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, Part II (retrieved 2026-11-22)
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, Part II (retrieved 2026-11-22)
- [14]
In Boumediene v. Bush (2008) the Supreme Court held that Guantanamo detainees were entitled to the habeas privilege and that, because the Detainee Treatment Act's review procedures were not an adequate substitute, section 7 of the Military Commissions Act operated as an unconstitutional suspension of the writ. confirmedas of 2026-11-21
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, Part IV (retrieved 2026-11-22)
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, introduction (retrieved 2026-11-22)
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, introduction (retrieved 2026-11-22)
- [15]
Boumediene named at least three factors for the Suspension Clause's reach - the detainees' citizenship and status and how it was determined, the nature of the sites of apprehension and detention, and practical obstacles to resolving entitlement to the writ. confirmedas of 2026-11-21
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, Part IV-A (retrieved 2026-11-22)
- Boumediene v. Bush, 553 U.S. 723 (2008), opinion of the Court · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 · Opinion of the Court, Part IV-A (retrieved 2026-11-22)
- [16]
Justice Kennedy wrote the Boumediene majority opinion, joined by Justices Stevens, Souter, Ginsburg and Breyer; Chief Justice Roberts filed a dissent joined by Justices Scalia, Thomas and Alito. confirmedas of 2026-11-21
- Boumediene v. Bush, 553 U.S. 723 (2008) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 (retrieved 2026-11-21)
- Boumediene v. Bush, 553 U.S. 723 (2008) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2008-06-12 (retrieved 2026-11-21)
- [17]
The respondent in DHS v. Thuraissigiam was a Sri Lankan national stopped 25 yards after crossing the southern border without inspection, and was detained for expedited removal. confirmedas of 2026-11-21
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
- [18]
In DHS v. Thuraissigiam (2020) the Court said the Suspension Clause at a minimum protects the writ as it existed in 1789, that habeas has traditionally been a means to seek release from unlawful detention, and that a claim seeking another chance to apply for asylum rather than release fell outside that scope. confirmedas of 2026-11-21
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
- [19]
In DHS v. Thuraissigiam (2020) the Supreme Court held that, for noncitizens seeking initial entry, decisions of executive or administrative officers acting within powers conferred by Congress are due process of law, and that a person detained shortly after unlawful entry has not "effected an entry". confirmedas of 2026-11-21
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
- Department of Homeland Security v. Thuraissigiam, 591 U.S. ___ (2020) · Cornell Law School Legal Information Institute (opinion text) · Primary source · 2020-06-25 (retrieved 2026-11-21)
Revision history (1)
- Page created.
Created Nov 21, 2026. Last reviewed by an editor on Nov 22, 2026. Next scheduled review: May 24, 2027.
Cite this page
"Habeas corpus explained: challenging detention in court." ContentLora, updated Nov 22, 2026. https://contentlora.com/explain/habeas-corpus-explained
Spotted an error? Suggest a correction or emailcorrections@contentlora.com.