330. Release of person of unsound mind pending investigation or trial —
(1) Whenever a person is found under section 328 or section 329 to be incapable of entering defence by reason of unsoundness of mind or mental retardation, the Magistrate or Court, as the case may be shall, whether the case is one in which bail may be taken or not, order release of such person on bail :
Provided that the accused is suffering from unsoundness of mind or mental retardation which does not mandate in-patient treatment and a friend or relative undertakes to obtain regular out-patient psychiatric treatment from the nearest medical facility and to prevent from doing injury to himself or to any other person.
(2) If the case is one in which, in the opinion of the Magistrate or Court, as the case may be, bail cannot be granted or if an appropriate undertaking is not given, he or it shall order the accused to be kept in such a place where regular psychiatric treatment can be provided, and shall report the action taken to the State Government :
Provided that no order for the detention of the accused in a lunatic asylum shall be made otherwise than in accordance with such rules as the State Government may have made under the Mental Health Act, 1987 (14 of 1987).
(3) Whenever a person is found under section 328 or section 329 to be incapable of entering defence by reason of unsoundness of mind or mental retardation, the Magistrate or Court, as the case may be, shall keeping in view the nature of the act committed and the extent of unsoundness of mind or mental retardation, further determine if the release of the accused can be ordered :
Provided that
(a) if on the basis of medical opinion or opinion of a specialist, the Magistrate or Court, as the case may be, decide to order discharge of the accused, as provided under section 328 or section 329, such release may be ordered, if sufficient security is given that the accused shall be prevented from doing injury to himself or to any other person;
(b) if the Magistrate or Court, as the case may be, is of opinion that discharge of the accused cannot be ordered, the transfer of the accused to a residential facility for persons of unsound mind or mental retardation may be ordered wherein the accused may be provided care and appropriate education and training.