A writ of habeas corpus is a court order that requires whoever is holding a person in custody to bring that person before a judge and justify the detention. The name comes from Latin for “produce the body.” It is the legal mechanism a prisoner, detainee, or their representative uses to ask a court whether the government has a lawful basis to keep them locked up, and it is protected by Article I of the U.S. Constitution.
What the Writ Actually Does
A habeas petition is not a second trial. It does not ask a judge to reweigh the evidence or decide whether the jury was right about guilt. It tests whether the process that produced the conviction or the detention violated the petitioner’s constitutional rights.1Office of the Law Revision Counsel. 28 U.S. Code 2254 – State Custody; Remedies in Federal Courts
Lawyers call this a collateral attack. Instead of appealing the verdict directly, the petitioner argues that something about the process was so broken that continued imprisonment is unconstitutional. Winning does not automatically open the cell door. A successful petition usually produces a new trial, a new sentencing hearing, or an order giving the state a set period to fix the constitutional violation.
Who Can File
Habeas is not limited to people serving criminal sentences. Anyone in government custody can petition. That includes immigration detainees who argue they are being held without legal authority, people committed to psychiatric institutions, and defendants held before trial. The common thread is physical confinement by the government and a claim that the confinement is unlawful.
In most cases the detained person files the petition themselves. When someone cannot file personally due to mental incapacity or lack of access to the legal system, a “next friend” can file for them. A next friend is typically a family member or attorney who shows a genuine interest in the detainee’s welfare and explains why the detainee cannot act alone.2Office of the Law Revision Counsel. 28 USC 2254 – State Custody; Remedies in Federal Courts – Advisory Committee Note
Common Grounds for a Petition
A habeas petition has to point to a specific legal defect. Vague complaints about unfairness do not qualify. The most common grounds include:
- Ineffective assistance of counsel. The petitioner’s lawyer performed so poorly that the Sixth Amendment right to a fair trial was undermined. This requires showing both that the performance fell below an objective standard of reasonableness and that the errors likely changed the outcome. A lawyer who failed to investigate an obvious alibi or ignored clearly inadmissible evidence could meet that bar.
- Prosecutorial misconduct. The prosecution knowingly used false testimony, hid evidence favorable to the defense, or otherwise violated due process. Withholding evidence that could have helped prove innocence is one of the strongest habeas claims available.
- Other constitutional violations at trial. A coerced confession, an improperly selected jury, or a guilty plea that was not entered voluntarily and knowingly.
- Newly discovered evidence. Information not available at trial, such as DNA results or a recanting witness, that demonstrates actual innocence.
State Prisoners and Federal Prisoners Use Different Procedures
The federal habeas process depends on which court convicted you, and confusing the two can waste years.
A state prisoner files a petition under 28 U.S.C. § 2254 in federal district court. That petition asks a federal judge to review whether the state proceedings violated the petitioner’s federal constitutional rights.1Office of the Law Revision Counsel. 28 U.S. Code 2254 – State Custody; Remedies in Federal Courts
A federal prisoner uses a different tool: a motion under 28 U.S.C. § 2255, filed in the same federal court that imposed the sentence. A § 2255 motion is broader than a § 2254 petition. A federal prisoner can argue that the sentence exceeded the legal maximum, that the court lacked jurisdiction, or that the conviction violated any federal law, not only the Constitution.3Office of the Law Revision Counsel. 28 U.S. Code 2255 – Federal Custody; Remedies on Motion Attacking Sentence A federal prisoner generally cannot use § 2254 unless the § 2255 process is inadequate or ineffective.
Exhaust State Remedies First
Before a state prisoner can bring a claim to federal court, they have to give every level of the state system a fair chance to address it. That usually means pursuing a direct appeal and then filing for state post-conviction relief, raising the same federal constitutional arguments at each stage.1Office of the Law Revision Counsel. 28 U.S. Code 2254 – State Custody; Remedies in Federal Courts
Narrow exceptions exist. A federal court can hear an unexhausted claim if the state provides no corrective process, or if the process available would not effectively protect the petitioner’s rights. A federal court can also deny an unexhausted claim on the merits.
The One-Year Deadline
The Antiterrorism and Effective Death Penalty Act of 1996 (AEDPA) imposes a strict one-year statute of limitations. Missing it usually ends the case, regardless of the strength of the underlying claims. The clock starts from the latest of four possible dates:4Office of the Law Revision Counsel. 28 U.S. Code 2244 – Finality of Determination
- The date the conviction became final, meaning when direct appeals concluded or the time to file them expired.
- The date a state-created impediment to filing was removed, if the state illegally prevented the petitioner from filing.
- The date the Supreme Court recognized a new constitutional right and made it retroactive.
- The date the petitioner could first have discovered the facts supporting the claim through reasonable diligence.
The one-year period pauses while a properly filed state post-conviction petition is pending. This statutory tolling matters because the exhaustion requirement would otherwise consume the entire limitations period.
Courts occasionally allow equitable tolling when a petitioner was diligently pursuing their rights but an extraordinary circumstance blocked timely filing. The bar is high. The petitioner must show consistent diligence and a genuinely extraordinary obstacle, such as a lawyer who abandoned the case entirely or a prison that confiscated legal materials.
Filing the Petition
State prisoners use Form AO 241, available from the U.S. Courts website.5U.S. Courts. Petition for Writ of Habeas Corpus Under 28 U.S.C. 2254 The form asks for the petitioner’s name and identification number, the facility of confinement, and the warden or superintendent, who serves as the respondent.
The petition has to include detailed information about the conviction under challenge: the court, the case number, and the date of judgment. It also requires a full history of prior legal actions, including direct appeals, state post-conviction filings, and any previous federal habeas petitions. For each ground raised, the petitioner has to lay out the supporting facts and explain how their constitutional rights were violated.
The petition is filed in federal district court. In states with more than one federal district, the petitioner can file either in the district where they are held or in the district where the convicting state court sits.6Office of the Law Revision Counsel. 28 USC 2241 – Power to Grant Writ The filing fee is $5, far below the standard $350 civil fee.7Office of the Law Revision Counsel. 28 USC 1914 – District Court; Filing and Miscellaneous Fees Petitioners who cannot pay can apply to proceed in forma pauperis.
There is no automatic right to an appointed lawyer for a habeas petition. Most petitioners file on their own, which partly explains why so many petitions are denied on procedural grounds. A federal judge has discretion to appoint counsel and must do so in two situations: when the court orders discovery that requires legal skill, and when the court schedules an evidentiary hearing.1Office of the Law Revision Counsel. 28 U.S. Code 2254 – State Custody; Remedies in Federal Courts
How the Court Reviews the Petition
A judge first conducts an initial screening. Petitions that are clearly meritless, vague, or fail to state a valid claim can be dismissed without further proceedings. Petitions that survive screening trigger a formal response from the government, usually filed by the state attorney general, which addresses the legal arguments and provides the relevant state court records.
Most habeas cases are decided on the written record from the state courts. An evidentiary hearing, with live witnesses and new evidence, happens only in specific circumstances. A hearing is required when the facts are genuinely disputed and the petitioner never received a full and fair hearing in state court. Otherwise, holding a hearing is up to the judge.
Why Most Petitions Fail: The AEDPA Deference Standard
This is where most habeas petitions die. Under AEDPA, a federal court cannot simply substitute its own judgment for the state court’s. A federal judge can grant relief only if the state court’s decision either “was contrary to, or involved an unreasonable application of, clearly established Federal law, as determined by the Supreme Court” or “was based on an unreasonable determination of the facts.”1Office of the Law Revision Counsel. 28 U.S. Code 2254 – State Custody; Remedies in Federal Courts
The word “unreasonable” carries enormous weight. A state court decision can be wrong and still survive federal habeas review. The petitioner has to show the state ruling was not just incorrect but so far off that no reasonable jurist could agree with it. Federal courts deny the vast majority of habeas petitions from state prisoners even when serious concerns exist about the underlying conviction. “Clearly established Federal law” is also limited to holdings from the U.S. Supreme Court, not from lower federal courts.
Second Petitions and Appeals
AEDPA makes filing a second habeas petition extremely difficult. A petitioner generally gets one shot. Any claim already raised in a prior petition will be dismissed outright. New claims not raised before will also be dismissed unless the petitioner can show one of two things:4Office of the Law Revision Counsel. 28 U.S. Code 2244 – Finality of Determination
- The claim relies on a new rule of constitutional law that the Supreme Court has made retroactive to cases on collateral review.
- The facts supporting the claim could not have been discovered earlier through due diligence, and those facts would establish by clear and convincing evidence that no reasonable factfinder would have found the petitioner guilty.
Before a second petition reaches a district court, the petitioner has to get permission from a three-judge panel of the U.S. Court of Appeals. The panel has 30 days to decide, and its ruling cannot be appealed. Even with authorization, the district court can still dismiss the petition if the claims do not meet the statutory requirements.
When a federal court denies a habeas petition, the petitioner cannot simply appeal. They first need a certificate of appealability, which requires a “substantial showing of the denial of a constitutional right.”8Office of the Law Revision Counsel. 28 U.S. Code 2253 – Appeal If the district judge denies the certificate, the petitioner can ask a circuit judge to issue one instead.9LII / Legal Information Institute. Federal Rules of Appellate Procedure Rule 22 – Habeas Corpus and Section 2255 Proceedings Without the certificate, the case ends at the district court.