— Offenders who have undergone preventive imprisonment shall be credited in the service of their sentence consisting of deprivation of liberty, with the full time during which they have undergone preventive imprisonment, if the detention prisoner agrees voluntarily in writing to abide by the same disciplinary rules imposed upon convicted prisoners, except in the following cases:
1. When they are recidivists or have been convicted previously twice or more times of any crime; and
2. When upon being summoned for the execution of their sentence they have failed to surrender voluntarily. If the detention prisoner does not agree to abide by the same disciplinary rules imposed upon convicted prisoners, he shall be credited in the service of his sentence with four-fifths of the time during which he has undergone preventive imprisonment. (As amended by Republic Act 6127, June 17, 1970).
Whenever an accused has undergone preventive imprisonment for a period equal to or more than the possible maximum imprisonment of the offense charged to which he may be sentenced and his case is not yet terminated, he shall be released immediately without prejudice to the continuation of the trial thereof or the proceeding on appeal, if the same is under review.
In case the maximum penalty to which the accused may be sentenced is destierro, he shall be released after thirty (30) days of preventive imprisonment. (As amended by E.O. No. 214, July 10, 1988).