(1) If, at the time when a person was surrendered in connection with a crime within the jurisdiction of the ICC, the person was serving a sentence of imprisonment in respect of an offence against a law of the Commonwealth or of a Territory, or was otherwise subject to detention under a law of the Commonwealth or of a Territory:
(a) any period spent by the person in custody in connection with the surrender warrant; and
(b) subject to subsection ( 2), any period spent by the person in custody in connection with detention by, or on the order of, the ICC in respect of the crime;
are to be counted as periods served towards the sentence of imprisonment or period of detention.
(2) If the person is convicted of the crime within the jurisdiction of the ICC, the period spent by the person in custody serving a sentence of imprisonment imposed by the ICC for the crime is not to be counted as a period towards the sentence of imprisonment or period of detention referred to in subsection ( 1).
(3) A reference in this section to a period spent in custody includes a reference to a period spent in custody outside Australia .