The article presents an analysis of selected issues concerning the application of a preventive measure in the form of pre-trial detention against an insane offender. It presents the admissibility of the occurrence in the given circumstances of the case of the general prerequisite from Article 249 § 1 of the Code of Criminal Procedure. and special prerequisites from Article 258 of the Code of Criminal Procedure. It also presents the procedural consequences in the scope of the possibility of temporary arrest in the case when the only premise for the application of temporary arrest was the concern about a severe punishment threatening the perpetrator, and in the course of proceedings there are premises for recognising that the perpetrator was not sane at the time of the act, which justifies the discontinuation of proceedings and application of a security measure in the form of placement in a closed psychiatric facility