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.
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.
| 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.
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.
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.
Confinement can never exceed the applicable abstract penalty: the calculation is controlled and the discharge prepared in advance with community resources and guardianships.
Post-custodial supervised release is given content shortly before release: the moment to fight for proportionate obligations compatible with real reinsertion.
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.
Speak to a criminal lawyer
Criminal defence in English before the courts of Alicante and the rest of Spain, for residents and for visitors who have flown home.