unsound mind

Translations
неустойчивое состояние ума
The judge ruled that he was of unsound mind at the time of the crime.
Судья постановил, что он был в неустойчивом состоянии ума на момент совершения преступления.