(1) Where a person has been charged with a federal offence on indictment and the person is acquitted because of mental illness at the time of the offence, the court must order that the person be detained in safe custody in prison or in a hospital for a period specified in the order, not exceeding the maximum period of imprisonment that could have been imposed if the person had been convicted of the offence charged.
(2) The Attorney - General may, at any time, by order in writing, vary the prison or hospital at which a person is detained under subsection (1).
(3) Where, for urgent medical or security reasons it becomes necessary to do so, an officer of the State or Territory in which a person is detained under this section may vary the prison or hospital at which the person is detained but, where the officer does so, the officer must forthwith notify the Attorney - General, in writing, of the variation and of the reasons for the variation.
(4) Despite subsection (1), the court may, if in the court's opinion it is more appropriate to do so than to make an order under subsection (1), order the person's release from custody either absolutely or subject to conditions to apply for such period as the court specifies in the order, not exceeding 3 years.
(5) The conditions may include:
(a) a condition that the person remain in the care of a responsible person nominated in the order; and
(b) a condition that the person attend upon a person nominated, or at a place specified, in the order for assessment of the person's mental illness, mental condition or intellectual disability and, where appropriate, for treatment.
(6) Where a person has been released from custody subject to conditions, the person or the Director of Public Prosecutions may, at any time, apply to the court to vary those conditions.