The Code of Criminal Procedure, 1973 (CrPc)
475. Delivery to commanding officers of persons liable to be tried by Court-martial.
(1) The Central Government may make rules consistent with this Code and the Army Act, 1950 (46 of 1950), the Navy Act, 1957 (62 of 1957), and the Air Force Act, 1950 (45 of 1950), and any other law, relating to the Armed Forces of the Union, for the time being in force, as to cases in which persons subject to military, navel or air force law, or such other law, shall be tried by a court to which this Code applies or by a Court-martial, and when any person is brought before a Magistrate and charged with an offence for which he is liable to be tried either by a court to which this Code applies or by a Court-martial, such Magistrate shall have regard to such rules, and shall in proper cases deliver him, together with a statement of the offence of which he is accused, to the commanding officer of the unit to which he belongs, or to the commanding officer of the nearest military, naval or air-force station, as the case may be, for purpose of being tried by a Court-martial.
Explanation. In this section-
(a) “Unit” includes a regiment, corps, ship, detachment, group, battalion or company.
(b) “Court-martial” includes any tribunal with the powers similar to those of a Court-martial constituted under the relevant law applicable to the Armed Forces of the Union.
(2) Every Magistrate shall, on receiving a written application for that purposes by the commanding officer of any unit or body of soldiers, sailors or airmen stationed or employed at any such place, use his utmost endeavors to apprehend and secure any person accused of such offence.
(3) A High Court may, if it thinks fit, direct that a prisoner detained in any jail situate within the State be brought before a Court-martial for trial or to be examined touching any matter pending before the Court-martial.