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 Sanhita 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 under any Central Act; 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 has not 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:
Provided further that no Court shall allow such withdrawal without giving an opportunity of being heard to the victim in the case.