A writ of habeas corpus orders the custodian of an individual in custody to produce the individual before the court to make an inquiry concerning his or her detention, to appear for prosecution (ad prosequendum) or to appear to testify (ad testificandum). State courts may issue such writs to prisoner custodians to produce federal prisoners.
Service
The issuing court will specify the party to execute the writ. The U.S. Marshal or Deputy U.S. Marshal will do so if ordered to by the court. A copy of the writ may be forwarded to the U.S. Marshal for information only even if he or she is not ordered to execute it.
Return
The executing party will make the return once the prisoner has satisfied the court-ordered appearance(s) and has been returned to the original place of incarceration. A partial return will be made when the custody of the prisoner has been relinquished to another authorized party for further removal.
State prisoners appearing before federal court to satisfy a writ of habeas corpus ad prosequendum or ad testificandum in federal criminal cases will remain in the U.S. Marshal's custody until the proceedings for which the writ was issued conclude, if so ordered by the court.
In cases where the Interstate Agreement on Detainers Act applies, after the prisoner's appearance in court, the court may order the prisoner to be returned to the state custodian pending further court proceedings.
If the case is a federal criminal matter, the U.S. Marshals Service will provide for the transportation and custody of state or federal prisoners whose production is commanded. If the writ is issued by a state court, the state must provide for the transportation and custody of the federal prisoner whose production it commands.
The state custodian is responsible for production of its prisoner from the state institution, and this responsibility cannot be shifted by the federal court to the U.S. Marshals Service. (See Pennsylvania Bureau of Corrections v. United States Marshals Service, 474 U.S. 34 (1985).
State authorities should retain custody of the prisoner within the federal courthouse and produce the prisoner directly before the court each day of the proceeding and house the prisoner for the duration of the proceeding.