Hi,
As per Section 84 of the Indian Penal Code, 1806 any act done by any person who is of unsound mind sahll not be construed as an offence and thus, the person committing the crime shall not be punished.
Section 84 provides for legal insanity and not not medical sanity and a distinction has to be made between the two. This came up for discussion before the Supreme Court in the case of Hari Singh and State of MP and the court opined that it is concerned with legal insanity and not mental insanity. The court also put the burden of proof on the accused to prove the his insanity by virtue of section 105 of the Indian Evidence Act.
A person can claim defense of section 84 when he not capable of distinguishing the right from the wrong and is also incapable of knowing the act being committed is contrary to the law. Only once this is established, can he claim relief provided under section 84. In all other cases, he shall be tried for the offence and if found guilty, be punished.
Best regards,
Megha