Article 95 [source]

Spanish Criminal Code
English translation

1. Security measures shall be applied by the Judge or Court, after obtaining any reports it deems appropriate, to persons who fall under the circumstances set forth in the following chapter of this Code, provided that the following conditions are met:

1. That the individual has committed an act defined as a crime.

2. That, based on the act and the individual's personal circumstances, a prognosis of future behavior can be deduced that reveals the likelihood of the commission of further crimes.

2. When the penalty that could have been imposed for the crime committed is not imprisonment, the sentencing judge or court may only order one or more of the measures provided for in Article 96.3.