Habeas Corpus in Spain: What It Is and How It Works
Last updated:
listIn this article
lightbulbKey Takeaways
- check_circleUrgent procedure (Organic Law 6/1984) against unlawful detention
- check_circleThe judge must rule within a maximum of 24 hours
- check_circleFiled by detainee, relatives, prosecutor, Ombudsman or judge
- check_circleNo lawyer or court agent required to start it
Quick answer
Habeas corpus is an urgent procedure, governed by Organic Law 6/1984, that brings any person who has been unlawfully detained — or held without the proper safeguards — before a judge without delay. The investigating judge must rule within a maximum of 24 hours: the judge hears the detainee, their lawyer, the public prosecutor and whoever carried out the arrest, and decides whether the deprivation of liberty is lawful or must be set aside. It can be filed by the detainee, their relatives, the public prosecutor, the Ombudsman (Defensor del Pueblo) or the judge of their own motion, and it does not require a lawyer or court agent.
Habeas corpus is one of the oldest and most effective safeguards against the arbitrary deprivation of liberty. The Latin phrase means, literally, “that you have the body”: the order by which a judge requires the detained person to be physically brought before them so that the lawfulness of the detention can be examined. In Spanish law it is the urgent channel for bringing a person who has been unlawfully detained before a judge without delay. As criminal lawyers who assist detained persons, we explain what the procedure is, who can file it, what time limits apply and what the judge can decide.
What habeas corpus is and what it is for
Habeas corpus is an urgent, summary judicial procedure governed by Organic Law 6/1984 and rooted in the Constitution itself, which recognises personal liberty as a fundamental right and expressly provides this route to give it effect. Its purpose is single and very specific: to obtain the immediate bringing before a judge of any person who has been unlawfully detained, so that the judge can review the circumstances of the detention and, where appropriate, set it aside.
It is worth establishing from the outset what habeas corpus is not, because this is one of the most common misunderstandings:
- It is not a trial on the merits. In this procedure the judge does not decide whether the person committed an offence, nor does the judge assess the evidence of the case. They examine only whether the detention is lawful.
- It is not a way to “get out earlier” of a lawful detention. If the deprivation of liberty respects the time limits and the safeguards, the judge will confirm it.
- It does not replace the later criminal defence. It is a specific safeguard about the lawfulness of the detention, not the defence strategy for any proceedings that may follow.
When a detention is unlawful
Habeas corpus is reserved for cases where the deprivation of liberty is unlawful or has taken place without the proper safeguards. Organic Law 6/1984 describes, in general terms, several typical situations that trigger the procedure:
- Detention without legal grounds: where there is no cause justifying depriving the person of liberty.
- Detention by someone who cannot order it: carried out or maintained by an authority or officer who lacks the power to do so, or without observing the required formalities.
- Detention prolonged beyond the limit: maintained beyond the legally provided period without bringing the detainee before a judge.
- Detention that disregards the detainee's rights: for example, without informing them of their rights, without allowing legal assistance, or without notifying those entitled to know of the detention.
In all these cases, habeas corpus allows a judge to intervene swiftly to verify what happened and to end the situation if it is indeed irregular. Certainty of unlawfulness is not required: a reasonably arguable situation is enough to trigger judicial review.
Who can file habeas corpus
One of the features that make this safeguard so effective is its very broad standing. It does not depend solely on the will of the detainee, who is often held incommunicado or without the means to react. It can be filed by:
- The detainee themselves.
- Their relatives and close ones: spouse or person in an equivalent relationship, descendants, ascendants and siblings, as well as their legal representative.
- Diplomatic or consular representatives, in the case of foreign nationals.
- The public prosecutor, as guarantor of legality and of citizens' rights.
- The Ombudsman (Defensor del Pueblo), in their role of protecting fundamental rights.
- The judge of their own motion, when they become aware of a detention that could be unlawful.
This breadth is deliberate: the law seeks to ensure that no one remains unlawfully detained simply because they cannot react. That is why a relative can start the procedure even though the detainee has not yet been able to contact a lawyer.
The procedure and the 24-hour deadline
Habeas corpus is designed to be quick and free of formalities. It does not require a lawyer or a procurador (court agent) to start it, nor the payment of a court fee, and it can be brought by a simple written request or even orally before the competent investigating judge. Its essential steps are:
- Application: addressed to the competent investigating judge, setting out who is detained, where, and why the detention is considered unlawful.
- Admission: the judge decides, by order, whether to open the procedure. If admitted, they order the detainee to be brought before them.
- Hearing: the judge hears the detainee, their lawyer, the public prosecutor and the authority or officer who carried out the arrest, and examines the documentation.
- Decision: the judge rules by order within a maximum of 24 hours from the start of the procedure.
That 24-hour deadline is the heart of the institution. Personal liberty admits no delay, so the law imposes immediate judicial review. Although a lawyer is not required, early legal assistance helps to frame the application, to monitor on the ground the respect for the detainee's rights, and to handle the hearing properly.
What the judge decides
After the hearing, the judge issues an order ending the procedure. The possible decisions are essentially two:
- Confirm the lawfulness of the detention: if the judge finds the deprivation of liberty to be in accordance with the law and to respect the safeguards, they close the habeas corpus and the situation continues.
- Find the detention unlawful or lacking safeguards: in that case the judge may order the detainee's immediate release; that they remain detained but under the custody of a different authority; their transfer to another facility; or the remedying of the legal safeguards that were omitted.
In addition, upholding habeas corpus may have consequences for whoever carried out or maintained an unlawful detention, opening the door to the relevant findings of liability. It must be stressed, however, that upholding a habeas corpus does not close the underlying criminal matter: it simply means that that detention could not be maintained on those terms.
This is why the lawyer's role does not end with the hearing. Once the lawfulness of the detention has been reviewed, it is usually necessary to prepare the defence of any proceedings that may follow, to decide the timing and content of any statement, and to ensure that the safeguards are maintained at every later stage. The settled case law of the Constitutional Court has stressed the essential nature of this safeguard and the duty of judges to give it real, and not merely formal, content.
⚖️ Do you believe you or a relative is being unlawfully detained?
The habeas corpus deadline is immediate and personal liberty admits no delay. We assist the detainee at the police station and before the court, frame the application and ensure their rights are respected throughout the hearing. A firm dedicated exclusively to criminal law, at Velázquez 27, Madrid.
Frequently asked questions
What exactly is habeas corpus?expand_more
It is an urgent, summary judicial procedure, governed by Organic Law 6/1984, whose purpose is for any unlawfully detained person to be brought before a judge at once. It is not used to decide the merits of the case or whether an offence was committed: it only allows a judge to check whether the detention is lawful and respects the safeguards, and to set it aside if it is not. It is a safeguard of personal liberty recognised in the Constitution itself.
Who can apply for habeas corpus?expand_more
Standing is very broad. It can be filed by the detainee; by their spouse or person in an equivalent relationship; by their descendants, ascendants and siblings; by their legal representative; and, for foreign nationals, by their diplomatic or consular representatives. The public prosecutor and the Ombudsman (Defensor del Pueblo) are also entitled to file it. In addition, the competent judge may start it of their own motion when they become aware of a detention that could be unlawful.
Do I need a lawyer and a court agent to file it?expand_more
No. Habeas corpus is designed to be quick and accessible: it does not require a lawyer or a procurador (court agent) to start it, nor the payment of any court fee, and it can be made by a simple written request or even orally. That said, obtaining legal assistance as early as possible helps to frame the application properly, to monitor the detainee's safeguards at the police station and to defend their rights throughout the hearing.
How quickly must the judge rule?expand_more
The investigating judge must rule within a maximum of 24 hours from the start of the procedure. That speed is the very reason for the institution: personal liberty admits no delay, so the law imposes immediate judicial review of any detention reported as unlawful or carried out without the proper safeguards.
What can the judge decide on habeas corpus?expand_more
If the judge finds the detention lawful, the procedure is closed and the situation continues. If the judge finds it unlawful or lacking safeguards, they may order the detainee's immediate release, their continued custody under a different authority, their transfer to a different facility, or the remedying of the legal safeguards that were omitted. A finding that the detention was unlawful may also lead to liability for the authority or officer who carried it out.
gavelDo you need criminal defense in this area?
We are criminal defense lawyers specializing in habeas corpus. We act urgently to protect your rights.