After a prisoner has given his or her testimony, or been surrendered, or his or her pretrial release discharged, or he or she has been tried for the crime with which he or she is charged, he or she shall be returned to the jail or other place of confinement from which he or she was taken for that purpose. If such prisoner is convicted of a crime punishable with death or imprisonment in the penitentiary, he or she may be punished accordingly; but in any case where the prisoner has been taken from the penitentiary, and his or her punishment is by imprisonment, the time of such imprisonment shall not commence to run until the expiration of the time of service under any former sentence.
735 ILCS 5/10-136