
Habeas Corpus: Defence of the Unlawfully Detained
Urgent habeas corpus procedure (Organic Law 6/1984) to challenge unlawful or irregular detentions. Judicial resolution within 24 hours.
Habeas corpus (Organic Law 6/1984) is a summary, urgent procedure to challenge an unlawful detention or one carried out in breach of fundamental rights, in which the judge must rule within 24 hours of the proceeding being opened. It may be requested by the detainee, their spouse or partner, ascendants, descendants or siblings, their legal representative, their defence lawyer (since Organic Law 5/2024), the Public Prosecutor's Office or the Ombudsman, and the judge may open it of their own motion. Typical grounds include detention without legal cause, detention extended beyond 72 hours without being brought before a judge, detention carried out without informing the person of their rights, or denial of access to legal counsel. It is a procedure with no formalities and no cost to the applicant, which our firm activates immediately when it detects irregularities at the time of arrest.
What Is Habeas Corpus
Habeas corpus is the oldest constitutional guarantee for the protection of personal liberty. It is governed by Article 17.4 of the Spanish Constitution and by Organic Law 6/1984 of 24 May. Its purpose is to obtain the immediate placement before the competent judicial authority of any person unlawfully detained, so that the judge verifies the circumstances of the detention and either regularises it or brings it to an end. It is a summary, urgent, free procedure with no formalities: the judge must resolve within a maximum of 24 hours.
Cases of Unlawful Detention
Article 1 of Organic Law 6/1984 lists the cases:
- Detention without legal cause: without a rational indication of an offence justifying the deprivation of liberty.
- Detention by an incompetent authority: carried out by someone lacking the power to detain.
- Prolonged detention: maintained beyond the time strictly necessary or, in any event, beyond 72 hours without release or placement before a judge (Art. 17.2 of the Constitution and Art. 520.1 LECrim); in terrorism cases, the judge may authorise an extension of up to 48 more hours (Art. 520 bis LECrim).
- Deprivation of liberty with breach of rights: without the reading of rights, without legal assistance, without notification to family or consulate, or in unofficial premises.
- Committal without the required guarantees: involuntary committals carried out without judicial authorisation.
Procedure and Timeframes
The procedure is extraordinarily swift: (1) Application by simple writ, oral appearance or telegram addressed to the on-duty Investigating Judge. (2) Opening order: the judge decides whether to admit the application. (3) Appearance: the detainee is immediately placed before the judicial authority; the judge hears the detainee, their lawyer, the Public Prosecutor and the officer who carried out the detention. (4) Resolution: within a maximum of 24 hours from the order opening the procedure, by an order ending the procedure.
Who Can Request Habeas Corpus
Standing is extraordinarily broad (Article 3 of Organic Law 6/1984): the detainee; their spouse or a person in an analogous relationship; descendants, ascendants and siblings; for minors, their legal representatives, and for persons with disabilities under judicial support measures, the person providing that support with power of representation; the Public Prosecutor; the Ombudsman; the detainee's defence lawyer (since Organic Law 5/2024); and, of their own motion, the competent judge. No lawyer or court representative is required, although immediate legal assistance speeds up and strengthens the procedure.
Effects and Consequences
If the judge finds the detention unlawful, they may order (Art. 8 LO 6/1984): (a) the immediate release of the detainee; (b) the continuation of the deprivation of liberty in accordance with the law, where necessary in a different facility or under different custody; or (c) the immediate placement of the person before the court if the legal detention period had already expired. Upholding the habeas corpus may also give rise to the criminal liability of the authority or official responsible for the unlawful detention (Arts. 167 and 530 CP).
Penalties & Consequences
| Type / Scenario | Criminal Penalty |
|---|---|
| Unlawful detention (Art. 167 CP) | An authority or official who carries out an unlawful detention receives the penalties of Arts. 163 to 166 in their upper half, which may be raised to the next degree (for basic detention, 5 to 9 years' imprisonment), plus absolute disqualification for 8 to 12 years. |
| Rights violation (Art. 530 CP) | Special disqualification from public employment or office for four to eight years for an authority or official who, where there is a criminal case, orders, carries out or prolongs a deprivation of liberty in breach of the time limits or other safeguards. |
| Patrimonial liability | Compensation for judicial error or abnormal functioning of Justice Administration (Art. 121 SC). |
* Penalties shown are indicative. The actual penalty depends on case circumstances, applicable mitigating and aggravating factors.
Our Defence Strategy
Telematic submission
Immediate submission via email to the duty service of the Court of Instance to gain time.
Visual documentation
When possible, capture of physical traces and testimonials about detention conditions.
Family and consular coordination
We immediately notify family and, if foreigner, corresponding consulate.
Action reserve
If detention was unlawful, assessment of criminal actions against authority and patrimonial liability claim.
Criminal Procedure in Spain: Fast Trials, Extraditions & Prison Law — Defence Guide
Beyond substantive criminal offences, Spanish law contains a complex procedural framework that directly affects defence strategy. Fast-track trials (juicios rápidos), extradition procedures (European Arrest Warrants and bilateral treaties), penitentiary law (classification grades, parole, sentence review) and juvenile justice (LO 5/2000) each demand specialised knowledge. Understanding procedural rights and deadlines is often decisive for the outcome of a case.
Key Procedural Frameworks
| Framework | Legal Basis | Scope | Key Feature |
|---|---|---|---|
| Fast-track trials | Arts. 795-803 LECrim | Offences punishable by up to 5 years prison | Trial listed within the following 15 days |
| European Arrest Warrant | Law 23/2014 | Cross-EU extradition | 60 days to decide without consent (+30 extension) |
| Prison classification | LO 1/1979 (LOGP) | Classification into grades 1, 2 or 3 | Open regime (grade 3) = semi-liberty |
| Conditional release | Arts. 90-93 CP | Release from prison on licence | Grade 3 + ¾ of sentence served + good conduct |
| Juvenile justice | LO 5/2000 | Offenders aged 14-17 | Sanctioning-educational measures, not criminal penalties |
| Criminal record expungement | Art. 136 CP | Deletion of criminal record | Timeframe varies by offence severity |
Key Defence Strategies
Fast-Trial Conformity Advantage
In fast-track proceedings, agreeing to a plea (conformidad) with the prosecution carries a one-third reduction of the sentence sought. This can make the difference between prison and a suspended sentence.
EAW Refusal Grounds
European Arrest Warrants may be refused on grounds of: ne bis in idem (double jeopardy), time-barred offence, minor's age, or if the person will serve the sentence in Spain. Each ground requires specific procedural challenges.
Prison Grade Review
Inmates may contest their classification grade before the Supervisory Judge (Juez de Vigilancia Penitenciaria). Progression to grade 3 (semi-liberty) requires demonstrating good conduct, personal development and reduced recidivism risk.
Juvenile Diversion
For minor or less serious offences committed without serious violence or intimidation, the Prosecutor may end the file and ask for it to be dismissed (sobreseimiento) if the minor reconciles with the victim or makes reparation (Art. 19 LO 5/2000); the technical team may also propose not continuing it (Art. 27.4). The defence can steer the case towards this outcome, which avoids the hearing and any judgment being entered in the juvenile register.
Key Case Law
In fast-track proceedings, once the duty court has checked that the plea meets the legal requirements, it imposes the sentence sought reduced by one-third, even below the statutory minimum.
The CJEU held that where there is a real risk of inhuman or degrading treatment because of detention conditions in the issuing State, the executing authority must request supplementary information and postpone its decision on surrender until that risk can be discounted; if it cannot be discounted within a reasonable time, it must decide whether to bring the procedure to an end.
The Constitutional Court holds that prison classification decisions must be reasoned and subject to periodic review, in line with the fundamental rights of sentenced persons under Art. 25.2 CE.
Why Choose Us?
Need a criminal defence lawyer for this type of offence? Here's how we work:
Need urgent criminal defence?
Contact our specialist criminal defence lawyers. We evaluate your case confidentially.
Tools for your case
We also serve
View all locations →This page is for information purposes only and does not constitute legal advice: every case requires individual assessment. How this content is produced and verified: editorial policy.
Do you need specialised legal assistance?
The judicial system is complex. We have the criminal-law specialisation and technical resources required to take on the defence.