Penal Code section 2620
(a)
When it is necessary to have a person imprisoned in the state prison brought before any court to be tried for a felony, or for an examination before a grand jury or magistrate preliminary to trial for a felony, or for the purpose of hearing a motion or other proceeding, to vacate a judgment, an order for the prisoner’s temporary removal from prison, and for the prisoner’s production before the court, grand jury, or magistrate, must be made by the superior court of the county in which action, motion, or examination is pending or by a judge thereof. The order shall be made only upon the affidavit of the district attorney or defense attorney, stating the purpose for which that person is to be brought before the court, grand jury or magistrate or upon the court’s own motion. The order shall be executed by the sheriff of the county in which it shall be made, whose duty it shall be to bring the prisoner before the proper court, grand jury or magistrate, to safely keep the prisoner, and when the prisoner’s presence is no longer required to return the prisoner to the prison from whence the prisoner was taken. The expense of executing such order shall be a proper charge against, and shall be paid by, the county in which the order shall be made.(b)
An order pursuant to subdivision (a) shall recite the purposes for which that person is to be brought before the court, grand jury, or magistrate, and shall be signed by the judge making the order and sealed with the seal of the court. The order must be to the following effect:(c)
When a prisoner is removed from a state prison under this section the prisoner shall remain in the constructive custody of the warden thereof. During the prisoner’s absence from the prison, the prisoner may be ordered to appear in other felony proceedings as a defendant or witness in the superior court of the county from which the original order directing removal issued. A copy of the written order directing the prisoner to appear before that court shall be forwarded by the district attorney to the warden of the prison having protective custody of the prisoner.
Source:
Section 2620, https://leginfo.legislature.ca.gov/faces/codes_displaySection.xhtml?lawCode=PEN§ionNum=2620.
(updated Jan. 1, 2025; accessed Jul. 14, 2025).