Habeas Corpus: How to Challenge an Unlawful Detention (2026)

Published on: October 10, 2026
Last updated: 12 July 2026

What a habeas corpus writ does, who can file it, in which court, and the steps to challenge an unlawful detention in India. The relaxed rules on who may apply, the urgency of the hearing, and who must justify the detention. Last verified October 2026.

Explainer · Constitutional Law · Writs

Habeas corpus means produce the body. It is the writ you use when a person is held in custody without lawful authority, whether by the State or by a private person. The court orders the person holding the detenu to bring them before it and to show the legal basis for the detention. If there is none, the detenu is released. This guide sets out what the writ does, who can file it, in which court, the steps involved, and how the court tests the detention. Last verified October 2026.

The short answer
  • What it does: habeas corpus orders the person holding a detenu to produce them in court and justify the detention.
  • Where: the Supreme Court under Article 32 or a High Court under Article 226.
  • Who can file: the detained person or any person on their behalf; the rules on who may apply are relaxed.
  • Burden: the detaining authority must prove the detention is lawful, not the other way round.

01When habeas corpus is the right remedy

Personal liberty is protected by Article 21 of the Constitution, which says no person shall be deprived of life or personal liberty except according to procedure established by law. When someone is detained without that lawful basis, habeas corpus is the fastest constitutional remedy to test the detention and secure release.

It is used in many situations: a person held by the police beyond the limits the law allows, a preventive detention that does not follow the required procedure, a person missing after being last seen in official custody, or even a person wrongfully confined by a private individual. The common thread is a deprivation of liberty that may have no lawful foundation.

02What the writ does

A writ of habeas corpus directs the person or authority holding the detenu to produce them before the court and to state the authority for the detention. The court then examines whether the detention is lawful. If it is not, the court orders the detenu to be released at once.

The writ is one of the five constitutional writs, and it can be issued by the Supreme Court under Article 32 and by the High Courts under Article 226. It is a remedy aimed at the fact of detention, so it looks at whether the person is being held lawfully today, not at deciding a wider dispute.

A remedy for the body, not for damages

Habeas corpus secures the release of a person held unlawfully. It is not a claim for compensation, though courts have in appropriate cases awarded compensation for an illegal detention. The first purpose is to free the person.

03Who can file, and in which court

The rules on who can file are deliberately relaxed, because the detenu is often in no position to approach the court. The petition can be filed by the detained person, or by any person on their behalf, such as a relative, a friend, or a public-spirited person. Courts have even acted on a letter or a postcard in genuine cases.

On the court, you have a choice:

  • A High Court under Article 226: usually the first and most practical forum, especially where the detention and the detaining authority are within that State.
  • The Supreme Court under Article 32: available where a fundamental right is directly infringed, or the matter has wider importance.

The difference between these two routes, and when to prefer each, is set out in the guide to Article 32 versus Article 226. For habeas corpus, the relaxed locus standi applies in both courts.

04How to file: the steps

The practical steps, in broad outline, are these. Court rules vary, so the local High Court rules should be checked for the exact form and fee.

  • Draft the petition: name the detenu, the detaining authority, and set out the facts of the detention and why it is unlawful. State the right infringed, usually Article 21.
  • Verify by affidavit: support the petition with an affidavit of the person filing it, stating the facts and the source of their knowledge.
  • File in the right court: file before the High Court under Article 226 or the Supreme Court under Article 32, with the court fee and copies that the rules require.
  • Seek an urgent hearing: because liberty is at stake, habeas corpus matters are usually heard urgently, and the court can issue notice to the detaining authority to produce the detenu and to justify the detention.

The exact court fee and format are set by the rules of each court and can change, so confirm them before filing.

05How the court tests the detention

Once the petition is admitted, the court issues notice and, where needed, directs the detenu to be produced. The crucial feature of habeas corpus is where the burden lies: the detaining authority must satisfy the court that the detention is lawful. It is not for the detenu to prove the detention is illegal.

The court looks at the legality of the detention as it stands at the time of the hearing. If the authority cannot show a valid legal basis, for example a valid remand order or a preventive detention order that follows the required safeguards, the court orders release. In preventive detention cases, the court also checks that the procedural protections, such as communication of grounds and the right to make a representation, were followed.

In a habeas corpus case, the person who holds the detenu must justify the detention. The burden is on the authority, not on the detained person.

06Limits and what happens next

Habeas corpus has limits. If the detention is under a valid order of a competent court, or a lawful remand, the writ will not ordinarily lie, because the detention has a legal basis. The remedy is aimed at unlawful custody, not at substituting the court view for a lawful one.

If the court finds the detention unlawful, it orders immediate release, and may pass further directions, including compensation in a fit case. If the detention is found lawful, the petition is dismissed. Because the writ is about present liberty, there is no ordinary limitation period to file, though delay can be a relevant factor the court considers.

07Where Claw fits

Claw is an all-in-one legaltech platform for Indian advocates, law firms, and corporate legal teams, combining AI-based case search, an AI legal assistant (Legal GPT), case management, and compliance automation across all Indian courts and tribunals.

Habeas corpus moves fast, and the right authority on relaxed locus standi or preventive detention safeguards can decide a matter in a single hearing. Claw lets you pull how a High Court or the Supreme Court tested a detention, searching 30 crore+ judgments that run from the Supreme Court in 1950 and the High Courts from 1990, with results in under 5 seconds. It also tracks a live writ petition, its cases, orders and hearings, across 9,102 courts, benches and forums, by the party name or the advocate name.

Claw does not use customer documents to train its AI models, so a detention brief you build stays yours. Create a free Claw account to follow a habeas corpus petition from filing to release. To search the wider body of law, see case search across Indian courts.

08Sources and further reading

This guide is general information, not legal advice. A detention case turns on its facts and the court rules, so check the current provisions and take advice from counsel before you act.

09Frequently asked questions

What is a writ of habeas corpus?

A writ of habeas corpus is an order of a constitutional court directing the person or authority holding someone in custody to produce that person before the court and to justify the detention. If the detention is unlawful, the court orders the person to be released.

Who can file a habeas corpus petition?

The detained person can file it, and so can any person on their behalf, such as a relative, a friend, or a public-spirited person. The rules on who may apply are relaxed, and courts have acted even on a letter in genuine cases, because the detenu is often unable to approach the court.

In which court do I file a habeas corpus petition?

You can file in a High Court under Article 226 or in the Supreme Court under Article 32. The High Court is usually the first and most practical forum, especially where the detention and the detaining authority are within that State.

Who has to prove the detention is lawful?

The detaining authority. In a habeas corpus case, the person or authority who holds the detenu must satisfy the court that the detention is lawful. It is not for the detained person to prove that the detention is illegal.

Can habeas corpus be used against a private person?

Yes. Habeas corpus can be issued against the State and also against a private person who wrongfully confines another. The question is whether the person is being held without lawful authority.

Can I track a habeas corpus matter in Claw?

Yes. Claw searches 30 crore+ judgments and tracks habeas corpus and other writ matters, their cases, orders and hearings, by party or advocate name across 9,102 courts, benches and forums, returning results in under 5 seconds. It helps you research and follow the case, and does not give legal advice.

Explore CLAW

The tools behind the guides

CLAW helps Indian advocates and firms manage cases, track courts and research the law.