Section 40. Conditions for imposing preventive detention

If a sentence of imprisonment is deemed insufficient to protect the life, health or freedom of other persons, preventive detention in an institution under the correctional services may be imposed when the offender is found guilty of having committed or attempted to commit a violent offence, sexual offence, unlawful imprisonment, arson or other offence that has infringed upon the life, health or freedom of another person or put these legal interests at risk and the conditions in the second or third paragraphs are met. If the person charged is under 18 years of age, preventive detention may not be imposed unless altogether extraordinary circumstances apply.
If the offence was serious in nature, there must be an obvious risk that the offender will again commit a serious offence as specified in the first paragraph.
If the offence was less serious in nature
  1. a.
    the offender must previously have committed or attempted to commit a serious offence specified in the first paragraph,
  2. b.
    it must be assumed that there is a close connection between the offence committed earlier and the offence now committed, and
  3. c.
    the risk of commission of a further, serious offence specified in the first paragraph must be particularly obvious.
In assessing the risk of commission of a further offence pursuant to the second and third paragraph, emphasis shall be given to the committed offence by reference particularly to the offender's conduct and social and personal functional capacity. In cases specified in the second paragraph, particular emphasis shall be given to whether the offender has previously committed or attempted to commit a serious offence specified in the first paragraph.
Before a sentence of preventive detention is passed, a personal examination of the person charged shall be carried out. The court may decide that the person charged shall be subjected to a forensic psychiatric examination instead of or in addition to the personal examination.