Criminal Code guide · Arts. 95 to 108

Criminal security measures: psychiatric confinement, outpatient treatment and supervised release

Updated to LO 1/2026 and LO 1/2025 · Reviewed July 2026 · Author: Francisco Javier Martín Porras, criminal lawyer and court expert · SCJE team

When the author of an offence is non-imputable or semi-imputable (exemptions of art. 20.1, 2 and 3), the response is not a penalty but a security measure: psychiatric confinement, outpatient treatment, supervised release. A system with its own logic (dangerousness instead of culpability) and limits the defence must watch: confinement cannot last longer than the penalty that would have been imposed. We comment on it in full, including supervised release for imputable persons.

In brief. In brief. Prerequisites: a criminal act plus an exemption or partial exemption plus a prognosis of dangerousness. Confinement cannot exceed the time the applicable prison penalty would have lasted. Review at least annual, with cessation, substitution or suspension possible. Supervised release also applies after prison to imputable persons in sexual and terrorism offences.

Practical keys

Art. 95
CP: proven criminal dangerousness, never presumed
Tope legal
confinement never exceeds the applicable abstract penalty
5-10
years of post-custodial supervised release in sexual and terrorism offences

Dangerousness instead of culpability: a system with limits the defence must enforce

Security measures apply to whoever has committed an act defined as an offence and whose circumstances reveal a probability of new offences: criminal dangerousness proven, not presumed (art. 95). Without a prior offence there is no measure: the system does not allow preventive confinements. The catalogue of art. 96 includes custodial measures (psychiatric confinement, detoxification centre, special educational centre) and non-custodial ones (supervised release, family custody, deprivation of driving or weapons licences, expulsion of foreign nationals), governed by necessity and proportionality. During execution, the judge maintains, ceases, substitutes or suspends the measure, with a review at least annual (arts. 97 and 98).

Our defence lines: the dangerousness prognosis is expert evidence about the future, and a criminal record is not a prognosis, so measures imposed on labels fall on appeal; credible outpatient treatment plans (centre, psychiatrist, frequency, written family commitment) as a real alternative to confinement, because judges confine less when the alternative is built; the essential guarantee cap, since confinement can never exceed the abstract applicable penalty; and execution monitored review by review, because “forgotten” confinements in prison psychiatric hospitals are challenged with requested reviews and complaints to the supervision judge.

Provision by provision

Security measures, article by article

Art. 95 CP

Prerequisites

Measures apply to whoever has committed an act defined as an offence and whose circumstances reveal a probability of committing new offences: proven criminal dangerousness, not presumed. Without a prior offence there is no measure: the system does not allow preventive confinements.
In practice

The prognosis question

Dangerousness is proved by expert evidence and refers to the future: a record is not a prognosis. We demand that the forensic report answer the correct question (probability of new offences and why) and not the history: measures imposed on labels fall on appeal.
Art. 96 CP

The catalogue

Custodial measures: psychiatric confinement, confinement in a detoxification centre or a special educational centre. Non-custodial: supervised release, family custody, deprivation of driving or weapons licences, expulsion of foreign nationals. The choice is governed by necessity and proportionality. The catalogue allows tailor-made suits: outpatient treatment linked to a specific centre is a real alternative to confinement when the family network sustains it. We present the plan (centre, psychiatrist, frequency, written family commitment): judges confine less when the alternative is built.
Arts. 97 and 98 CP

Execution and review

During execution the judge (on the proposal of the supervision judge) may maintain, cease, substitute or suspend the measure, with a review at least annual based on the practitioners’ reports. The review is not a formality: it is the moment to prove evolution and request the transition to outpatient treatment. The annual review is a right, not a favour: we request updated reports and a hearing. “Forgotten” confinements are fought with requested reviews and complaints to the supervision judge: every year without review is a challengeable year.
Arts. 101 to 104 CP

Confinements and the time cap

The person non-imputable due to psychic anomaly may be confined for medical treatment in an adequate centre, without the confinement exceeding the time the custodial penalty applicable to the act would have lasted: the essential guarantee cap. In partial exemptions (art. 104), the measure accompanies the reduced penalty under the vicarial system of art. 99: first the measure, credited against the penalty. The cap is calculated and invoked: confinements approaching the limit demand advance preparation of the discharge (community resources, guardianships), and liquidations ignoring the vicarial credit are appealed.
Art. 106 CP

Supervised release

Submission to judicial control through obligations: permanent electronic localisation, appearances, programmes, prohibitions of approach or residence. As a measure for non-imputable persons or, a novelty of 2010-2015, as a measure imposed in the judgment on imputable persons and executed after prison in sexual and terrorism offences (up to 10 years): the post-custodial control that conditions life after the sentence.
In practice

Post-custodial content is fought at the end

Post-custodial supervised release is given content at the end of the service: it is the moment to fight for proportionate obligations (less tag and more programme, realistic distances). Its breach is an autonomous offence: we go through every obligation in writing with the client on the day of release.
Art. 108 CP

Foreign nationals

Security measures applicable to foreign nationals without legal residence may be substituted by expulsion, with the same safeguards and hearing as the substitution of penalties of art. 89: the roots and the real access to treatment in the destination country are litigated. Expelling a psychiatric patient without a network to their country of origin is an invocable disproportion. We defend or fight the expulsion according to the client’s real interest, not by inertia.
The civil border

When the criminal cap is reached

Once the time cap is reached, only the civil route of non-voluntary confinement remains, where applicable: controlling that calculation prevents indefinite confinements against the law.
The system at a glance

Summary table: measure, legal basis and guarantee

Measure or rule Legal basis Content Guarantee or key
Prerequisites Art. 95 CP Offence, exemption and prognosis of dangerousness Dangerousness proven, never presumed
Psychiatric confinement Art. 101 CP Medical treatment in an adequate centre Never longer than the applicable abstract penalty
Detox and educational centres Arts. 102-103 CP Addictions and intellectual disability Same time cap and annual review
Partial exemption Art. 104 CP Measure plus reduced penalty Vicarial system: the measure is credited (art. 99)
Outpatient treatment Art. 96 CP Linked to a specific centre and plan Real alternative when the network sustains it
Supervised release (non-imputable) Art. 106 CP Localisation, appearances, programmes, prohibitions Reviewable; content ruled by proportionality
Post-custodial supervised release Art. 106 CP After prison in sexual and terrorism offences Up to 5 or 10 years; content fixed before release
Substitutive expulsion Art. 108 CP Foreign nationals without legal residence Hearing, roots and treatment in destination litigated

Summary drawn from the Spanish source page for orientation purposes. The applicable provisions are those of the Criminal Code in force at the relevant time; each case requires individual analysis by a criminal lawyer.

How we defend these cases

Therapeutic objective, guaranteed limits

Original commentary by the firm, checked against the reference works of our library and updated to LO 1/2026 and LO 1/2025. The system replaces culpability with dangerousness, and precisely for that reason its limits are non-negotiable: the correct expert question, the time cap, the annual review and the built alternative decide these executions.

01

Forensic reports answering the correct question: future probability, not history

02

Credible outpatient treatment plans as an alternative to confinement

03

The time cap calculated and invoked, with the discharge prepared in advance

04

Execution monitored: requested reviews, updated reports, complaints to the supervision judge

Timeline

A security measure, step by step

Phase 01

Judgment: exemption or partial exemption declared, dangerousness prognosis debated and the measure chosen under necessity and proportionality

Phase 02

Execution: treatment in an adequate centre or outpatient plan; in partial exemptions, the vicarial credit against the penalty (art. 99)

Phase 03

Annual review: updated reports and hearing; cessation, substitution or suspension requested with proven evolution (arts. 97 and 98)

Phase 04

End of the measure: the time cap closes the criminal route; discharge prepared with community resources, or the civil route where it proceeds

Who we assist

Situations where this defence is decisive

🏥

Families of persons acquitted with an exemption

Acquittal under art. 20.1 is usually accompanied by a measure if there is a dangerousness prognosis: with a time cap, annual review and a therapeutic objective. Every review is an opportunity.

⏱

Persons confined near the time cap

Confinement can never exceed the applicable abstract penalty: the calculation is controlled and the discharge prepared in advance with community resources and guardianships.

📿

Persons finishing sentences for sexual or terrorism offences

Post-custodial supervised release is given content shortly before release: the moment to fight for proportionate obligations compatible with real reinsertion.

🌍

Foreign nationals facing substitutive expulsion

Expulsion requires a hearing and analysis of roots and available treatment in the destination: expelling a psychiatric patient without a network is an invocable disproportion.

FAQ

Frequently asked questions on security measures

My relative was acquitted on psychiatric grounds. Are they free?
Not necessarily: acquittal under art. 20.1 is usually accompanied by a security measure if there is a dangerousness prognosis, normally confinement for treatment or outpatient treatment. The good news: it has a time cap (the penalty that would have corresponded), an annual review and a therapeutic, not punitive, objective. The defence keeps working during the execution: every review is an opportunity.
How long can a criminal psychiatric confinement last?
At most, what the prison penalty applicable to the offence committed would have lasted: a confinement for injuries with a maximum penalty of 3 years cannot exceed 3 years. Once the cap is reached, only the civil route of non-voluntary confinement remains, where applicable. Controlling that calculation prevents indefinite confinements against the law.
What is the supervised release served after prison?
A measure imposed in the judgment itself for sexual and terrorism offences, activated upon leaving prison: tag, appearances, programmes, prohibitions, for up to 5 or 10 years. Its specific content is fixed shortly before release on the proposal of the supervision judge: that is the moment to fight for proportionate obligations compatible with real reinsertion.

Speak to a criminal lawyer

In a fast-track case, the days you have are the case.

Criminal defence in English before the courts of Alicante and the rest of Spain, for residents and for visitors who have flown home.

Logotipos-abogacia-scje
Paseo De La Castellana 216 8º 28046 Madrid
Alicante – Playa de San Juan Av. Ansaldo 31, local 16, 03540 Alicante
London: 20 Wenlock Road, N1 7GU, United Kingdom
Paris: 72 Faubourg St Honoré, 75008, France
info@societejuridique.com

Société de Conseil Juridique et Expert is a law firm with offices in Madrid, Alicante, London and Paris, specialising in criminal law, technology law and economic and corporate crime. We provide strategic guidance in complex criminal proceedings, intellectual property and technological resources for legal decision-making with advanced forensic analysis. Our multidisciplinary team combines legal experience, legal intelligence and personal attention to deliver effective solutions adapted to each case. Legal assistance available 24 hours a day and online consultations.

Copyright © 2026 Société de Conseil Juridique et Expert S.L.

EspanolEnglishFrancaisРусскийItalianoDeutsch
WhatsApp · Urgencias 24h