As I said earlier, the Dutch have a system called "Terbeschikkingstelling van de Staat" (TBS), literally "Being put at the disposal of the state". It's a measure that is formally not a punitive, but a psychiatric sanction. In cases where a judge rules that the culprit is (partially) insane and therefore can't (entirely) be held acountable, he can order that the convict is placed in TBS. If there's also a prison sentence included (in cases where the insanity is held to only partially reduce the accountability), then he has to serve out that before being placed in TBS.
Having google-translated the wiki page on Forvaring, I'm not sure it's quite the same thing. According to the translation Forvaring applies to sane convicts.
Bookmarks