Under Section 321 in The Code Of Criminal Procedure, 1973
321. Withdrawal from prosecution. The Public Prosecutor or Assistant Public Prosecutor in charge of a case may, with the consent of the Court, at any time before the judgment is pronounced, withdraw from the prosecution of any person either generally or in respect of any one or more of the offences for which he is tried; and, upon such withdrawal,-
(a) if it is made before a charge has been framed, the accused shall be discharged in respect of such offence or offences;
(b) if it is made after a charge has been framed, or when under this Code no charge is required, he shall be acquitted in respect of such offence or offences: Provided that where such offence-
(i) was against any law relating to a matter to which the executive power of the Union extends, or
(ii) was investigated by the Delhi Special Police Establishment under the Delhi Special Police Establishment Act, 1946 (25 of 1946 ), or
(iii) involved the misappropriation or destruction of, or damage to, any property belonging to the Central Government, or
(iv) was committed by a person in the service of the Central Government while acting or purporting to act in the discharge of his official duty, and the Prosecutor in charge of the case hag hot been appointed by the Central Government, he shall not, unless he has been permitted by the Central Government to do so, move the Court for its consent to withdraw from the prosecution and the Court shall, before according consent, direct the Prosecutor to produce before it the permission granted by the Central Government to withdraw from the prosecution.