Here is how it is (according to the Pakistan Observer) when military personnel are not subject to civilian criminal justice unless military authorities agree:
Court of Omer Shabbir, civil judge/magistrate on Thursday handed over the sitting army officer Major Zahid Raja to Military Police (MP), who was arrested by Sihala Police in a murder case. The counsel of accused Army officer pleaded before the court that under section 549 of Code of Criminal Procedure the magistrate will deliver the person subject to Military, Naval or Air Force liable to be tried for Court-martial on the written request of Commanding Officer of regiment corps.
According to police, Army officer killed an assistant lineman Mehboob Ahmad on Wednesday when the latter reached his house located in DHA phase II to disconnect electricity connection over non-payment of dues. The army man opened fire at Islamabad Electric Supply Company (IESCO) Asst. lineman, who died on the spot, and later dumped his dead body near Gujjar Khan with help of his cousin.
Section 549 of Criminal Procedure Code stated: The Central Government may make rules consistent with this Code and the [Pakistan Army Act, 1952 (XXXIX of 1952), the Pakistan Air Force Act, 1953 (VI of 1953, and the Pakistan Navy Ordinance, 1961 (XXXV of 1961] and any similar law for the time being in force as to the cases in which person subject to military naval or air force law shall be tried by a Court to which this Code applies, or by Court-martial, and when any person is brought before a Magistrate and charged with an offense 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 offense of which he is accused to the commanding officer of the regiment, corps, ship or detachment to which he belongs, or to the commanding officer of the nearest military, naval or air force station, as the case may be, for the purpose of being tried by Court-martial.
Notwithstanding anything contained in this Code, if the person arrested by the Police is a person subject to the Pakistan Army Act, 1952 (XXXIX of 1952) and the offense for which he is accused is tried by a Court-martial, the custody of such person and the investigation of the offense of which he is accused may be taken over by the Commanding Officer of such person under the said Act.
The counsel of accused submitted a written request under signed by Director General GHQ seeking the departmental trial following the Court-martial if person liable to prove guilty. Court of Omer Shabbir, civil judge/magistrate after thorough examination of documents subjected in this particular case, ordered the Islamabad Capital Police under section 549 to hand over the arrested sitting army officer Major Zahid Raja to Military Police (MP). A large number of policemen were deputed in and outside of the court, while the officials of military police, security agencies and GHQ were also present there. Major Adeel from the Judge Advocate General Branch (Pakistan Army) dealing with the cases of Court-martial received the accused army officer and give him into the custody of MP, while another accused in this case named Minhaj was sent to jail on judicial remand.In effect, then, Pakistani civilian courts have no jurisdiction over military personnel (unless the military permits the civilian courts to exercise jurisdiction) while, per the 21st Amendment, military courts have jurisdiction over civilians.