Petition for Writ of Habeas Corpus

A petition asking a court to order the release of a person held in custody in violation of the Constitution or laws or treaties of the United States. A habeas petition is generally a civil case, separate from the criminal case; a federal prisoner's § 2255 motion is instead filed with the court that imposed the sentence.

Governing rule
28 U.S.C. §§ 2241, 2243, 2244(d), 2254, 2255
Type
Filing
Stage
Before filing
When it is used
After a person is in custody; for state prisoners, generally after state remedies are exhausted and within the one-year limitation period.
Petition for Writ of Habeas Corpus — a magnifying glass over legal documents

When the petition for writ of habeas corpus is used

Timing: after a person is in custody; for state prisoners, generally after state remedies are exhausted and within the one-year limitation period. This step usually happens before a lawsuit is filed or right as it begins. At this point, the parties decide where and how the case will proceed.

What the rule requires

  • The Supreme Court, any justice, the district courts and any circuit judge may grant writs of habeas corpus within their respective jurisdictions (28 U.S.C. § 2241(a)).
  • For example, the writ extends to a prisoner in custody in violation of the Constitution or laws or treaties of the United States, among other listed situations (28 U.S.C. § 2241(c)(3)).
  • Next, a court entertaining an application must forthwith award the writ or issue an order directing the respondent to show cause why the court should not grant it. The court need not do so if the application itself shows that the applicant or person detained is not entitled to it (28 U.S.C. § 2243).

More rules for the petition for writ of habeas corpus

  • A person in custody under a state-court judgment applies under 28 U.S.C. § 2254. In general, that applicant must first exhaust the remedies available in the state courts (§ 2254(b)(1)(A)).
  • In addition, a one-year limitation period applies to an application by a person in custody under a state-court judgment. However, the clock pauses while a properly filed state post-conviction application is pending (28 U.S.C. § 2244(d)(1)–(2)).
  • Finally, a federal prisoner challenging a federal sentence generally moves the sentencing court under 28 U.S.C. § 2255, which has its own one-year limit (§ 2255(f)). A court will not entertain a § 2241 petition unless the § 2255 remedy is inadequate or ineffective to test the legality of the detention (§ 2255(e)).

In practice, read each requirement closely. Then check whether your court adds anything of its own. For example, many courts set page limits, formatting rules or a duty to confer with the other side first.

You can read the full text of 28 U.S.C. §§ 2241, 2243, 2244(d), 2254, 2255 online. Also, the federal judiciary publishes the current rules and recent amendments.

The petition for writ of habeas corpus in state court

This page covers the federal version. In state court, the petition for writ of habeas corpus may have a different name, a different deadline or a different form. For example, a state may count days differently or require a separate notice. So start with your state’s rules of civil procedure, then check the local rules. Our state procedures guide links to the official rules for every state and DC.

Key terms

In addition, these terms come up often with this procedure:

  • Writ: a formal written order issued by a court commanding a person or official to do, or not to do, something.
  • Petition: a formal written request to a court or other official body.

Related procedures

Similarly, these procedures often come up alongside it:

  • Request for Order to Show Cause: a request asking the court to issue an order to show cause — an order directing a party or person to appear and explain why the court should not take a stated action, such as holding them in contempt for disobeying an order, granting an injunction or imposing sanctions.
  • Notice of Appeal: the filing that starts an appeal from a federal district court to a court of appeals.

Before you rely on this page

Always read the current rule yourself instead of relying on a summary. Next, check the local rules and the judge’s standing orders, since they often add steps. Then look for recent decisions from your court that apply the rule. Finally, talk to a licensed attorney about your situation. You can find one in our directory.

State court procedure for this filing

The federal rule above applies in federal court. In state court, the same filing is governed by that state's own rules of civil procedure, statutes and local court rules. Many states model their rules on the Federal Rules of Civil Procedure, so the requirements are often similar, but names, numbers, deadlines and forms can differ. Always use the version that applies to the court where your case is filed.

Examples from the largest state court systems

StateWhere to look
Federal courts28 U.S.C. §§ 2241, 2243, 2244(d), 2254, 2255
CaliforniaCal. Penal Code § 1473 (writ of habeas corpus)
New YorkN.Y. C.P.L.R. Article 70, § 7002 (habeas corpus)
TexasTex. Code Crim. Proc. art. 11.07 (felony post-conviction habeas, non-death cases)
FloridaFla. R. Crim. P. 3.850 (motion to vacate, set aside, or correct sentence); Fla. R. App. P. 9.141 (review in postconviction cases)

Each state citation was checked against the rule or code text (official source or a published copy) on October 24, 2026. Rules are amended often, so confirm the current version on the state's official site below.

Find the rule in your state

In your state's rules, look for the rule on petition for writ of habeas corpus. In states that number their rules like the federal rules, it is often the same rule number as the federal rule.

Official civil procedure rules for every state

Sources

  • 28 U.S.C. §§ 2241, 2243, 2244(d), 2254, 2255

Official sources:
lawtopolis.com/usc/28/2241
uscourts.gov/rules-policies/current-rules-pra…

Sources last reviewed: 2026-10-24

Lawtopolis provides legal information and education, not legal advice. Using this site does not create an attorney-client relationship. Laws and court rules vary by jurisdiction and change over time; verify every authority against the official source and consult a licensed attorney in your jurisdiction about your situation.