(1) A surety desiring to surrender a defendant shall deliver a copy of the bond and the defendant to the official who had custody of the defendant at the time bail was taken or to the official into whose custody the defendant would have been placed if she or he had been committed. The official shall take the defendant into custody, as on a commitment, and issue a certificate acknowledging the surrender.
(2) When a surety presents the certificate and a copy of the bond to the court having jurisdiction, the court shall order the obligors exonerated and any money or bonds deposited as bail refunded. The surety shall give the state attorney 3 days’ notice of application for an order of exoneration and furnish the state attorney a copy of the certificate and bond.
(3) The surety shall be exonerated of liability on the bond if it is determined prior to breach of the bond that the defendant is in any jail or prison and the surety agrees in writing to pay the transportation cost of returning the defendant to the jurisdiction of the court. For purposes of this subsection, “jurisdiction” means within the judicial circuit as prescribed by law.