The Code of Criminal Procedure, 1973 (CrPc)
328. Procedure in case of accused being lunatic.
(1) When a Magistrate holding an inquiry has reason to believe that the person against whom the inquiry is being held is of unsound mind and consequently incapable of making his defence, the Magistrate shall inquire into the fact of such unsoundness of mind, and shall cause such person to be examined by the civil surgeon of the district or such other medical officer as the State Government may direct, and thereupon shall examine such surgeon or other officer as a witness and shall reduce the examination to writing.
(2) Pending such examination and inquiry, the Magistrate may deal with such person in accordance with the provisions of section 330.
(3) If such Magistrate is of opinion that the person referred to in sub-section (1) is of unsound mind and consequently incapable of making his defence, he shall record a finding to that effect and shall postpone further proceedings in the case.