(a) Except as provided in (g) of this section, the court retains jurisdiction over the case and may at any time stay execution, modify, set aside, revoke, or enlarge a judgment or order, or grant a new hearing, in the exercise of its power of protection over the minor and for the minor's best interest, for a period of time not to exceed the maximum period otherwise permitted by law or in any event extend past the day the minor becomes 19, unless sooner discharged by the court, except that the department may apply for and the court may grant an additional one-year period of supervision past age 19 if continued supervision is in the best interests of the person and the person consents to it. An application for any of these purposes may be made by the parent, guardian, or custodian acting in behalf of the minor, or the court may, on its own motion, and after reasonable notice to interested parties and the appropriate department, take action that it considers appropriate.
(b) If the court determines at a hearing authorized by (a) of this section that it is in the best interests of the minor to be released to the care or custody of the minor's parent, guardian, or custodian, it may enter an order to that effect and the minor is discharged from the control of the department.
(c) If a minor is adjudicated a delinquent before the minor's 18th birthday, the court may retain jurisdiction over the minor after the minor's 18th birthday for the purpose of supervising the minor's rehabilitation, but the court's jurisdiction over the minor under this chapter never extends beyond the minor's 19th birthday, except that the department may apply for and the court may grant an additional one-year period of supervision past age 19 if continued supervision is in the best interests of the person and the person consents to it. The department may retain jurisdiction over the person between the person's 18th and 19th birthdays for the purpose of supervising the person's rehabilitation, if the person has been placed under the supervision of the department before the person's 18th birthday, except that the department may apply for and the court may grant an additional one-year period of supervision past age 19 if continued supervision is in the best interests of the person and the person consents to it.
(d) The department, or the district attorney in a matter subject to the jurisdiction of this chapter under AS 47.12.020(b), may petition the court for imposition of sentence pronounced under AS 47.12.120(j)(2) if the offender is still subject to the jurisdiction of the court and if the offender, after pronouncement of sentence under AS 47.12.120(j)(2),
(1) commits a subsequent felony offense;
(2) commits a subsequent offense against a person that is a misdemeanor and involves injury to a person or the use of a deadly weapon;
(3) fails to comply with the terms of a restitution order;
(4) fails to engage in or satisfactorily complete a rehabilitation program ordered by a court or required by a facility or juvenile probation officer; or
(5) escapes from a juvenile or other correctional facility.
(e) If a petition is filed under (d) of this section and if the court finds by a preponderance of the evidence that the minor has committed a subsequent felony offense that is a crime against a person or is the crime of arson, the court shall impose the adult sentence previously pronounced under AS 47.12.120(j) and transfer custody of the minor to the Department of Corrections. If the court finds by a preponderance of the evidence that any of the other circumstances set out in (d)(1) - (5) of this section exist, the court shall impose the adult sentence previously pronounced and transfer custody of the minor to the Department of Corrections unless the minor proves by preponderance of the evidence that mitigating circumstances exist that justify a continuance in the stay of the adult sentence and the minor is amenable to further treatment under this chapter. The court shall make written findings to support its order.
(f) Notwithstanding another provision of law, the court shall accept
(1) payments of restitution from a minor and the minor's parent at any time; and
(2) prepayments of restitution or payments in anticipation of an order of restitution.
(g) If the department has filed a delinquency petition under AS 47.12.020 and 47.12.040 regarding a minor who is 18 years of age or older, the court has jurisdiction to adjudicate and dispose of the matter as provided in this chapter.