(1) Whosoever as a public official involved in the enforcement of a sentence of imprisonment, a custodial measure of rehabilitation and incapacitation or detention by a public authority enforces such a sentence, measure or detention although it may not by law be enforced shall be liable to imprisonment from one to ten years, in less serious cases to imprisonment from three months to five years.
(2) If the offender acts grossly negligently the penalty shall be imprisonment not exceeding one year or a fine.
(3) Whosoever as a public official involved in the enforcement of a sentence or a measure (section 11(1) No 8) other than in cases under subsection (1) above enforces a sentence or measure although it may not by law be enforced shall be liable to imprisonment from three months to five years. Whosoever as a public official involved in the enforcement of
1. juvenile detention;
2. a summary fine or ancillary order under the law on summary offences;
3. a fine or detention for disobedience of a judicial order; or
4. a disciplinary proceeding, disciplinary court or professional disciplinary court proceeding,
enforces such a sanction although it may not by law be enforced shall incur the same penalty. The attempt shall be punishable.