Federal prisoners in US Marshals custody may lawfully be transferred to the custody of a state or local government pursuant to a state writ of ad prosequendum. This Chapter explains the writ of habeas corpus and lays out the procedures you will need to follow to petition for the writ.A writ of habeas corpus ad testificandum is an order from a court that a prisoner be brought to court to testify. Legal Consult Recommended. Petition For Writ Of Habeas Corpus By A Person In State Custody Pursunat To 28 USC (Non Death Penalty) Form. See Mauro, 436 U.S. at 361 (writ of habeas corpus ad prosequendum not detainer). Petitioner was in state custody on a parole violation when he was transferred to federal custody pursuant to a Writ of Habeas Corpus Ad Prosequendum. Therefore, the application of habeas corpus ad prosequendum in the instant case could not be granted. The following COMPLETE case number: CV 77−479−PHX−NVW. McGirt, a federal magistrate judge issued a writ of habeas corpus ad prosequendum, and he was ultimately brought.