Plaintiff, the District Attorney of Multnomah County, appeals from an order denying his petition for a writ of mandamus directed to the defendant judge. Plaintiff seeks to compel defendant to dismiss a petition for diversion by a person charged with driving while under the influence of intoxicants. We conclude that plaintiff is entitled to issuance of the writ, and we reverse.
Davis, the DUII defendant, filed a petition for diversion pursuant to ORS 484.445 et seq. Plaintiff objected to the petition on the ground that Davis had been convicted of DUII within the ten-year period before committing the offense with which he is now charged. ORS 484.450(4)(a). Defendant, acting in his capacity as a district court judge, allowed Davis’ petition and rejected plaintiffs objection on the ground, inter alia, that the earlier conviction was invalid because Davis had not been represented by counsel and “the record [of the earlier proceeding] is silent as to whether [Davis] was otherwise fully advised of all relevant constitutional and statutory rights and liabilities.”
ORS 484.450(4)(a) provides, as relevant:
“(4) * * * [T]he court may allow a petition for a driving while under the influence of intoxicants diversion agreement unless:
“(a) Within 10 years before the date of commission of the present offense the defendant was convicted of the offense of driving while under the influence of intoxicants or its statutory counterpart in this state or of the statutory counterpart of that offense in any other state.” (Emphasis supplied.)
After defendant made his ruling on the diversion petition and after the trial court entered the order in this proceeding, we concluded in State v. Wright, 63 Or App 482, 664 P2d 1131 (1983):
“Although the granting of the petition for diversion is discretionary with the trial court, there is no discretion to grant diversion if the defendant has been convicted of the offense of DUII within ten years before the date of the present offense. Defendant argues that, because the prior conviction was obtained without counsel, it does not operate as a matter of law to preclude diversion. * * *
a* * * * *
*212“* * * [Defendant was not entitled to challenge the validity of his prior conviction in the present prosecution.” 63 Or App at 484-86.
It follows that defendant here had a mandatory duty to dismiss Davis’ diversion petition. Davis was not entitled to challenge the validity of his earlier conviction; defendant had no authority to consider whether the conviction was valid; and under ORS 484.450(4) (a), the existence of the conviction divested defendant of any discretion to allow Davis’ diversion petition.
Defendant argues that “[a]t the time of [his] order, there was no clearly defined and well-settled applicable rule of law” and that defendant’s action was therefore an exercise of his judicial discretion. Wright was decided after defendant issued his order, and able judges could have arrived at a conclusion different from the one we reached in Wright. See, e.g., the dissenting opinion of Buttler, P.J. in Wright, 63 Or App at 486-87. However, we do not agree that defendant’s actions were therefore discretionary. We are called upon here, as we were in Wright, to interpret and apply ORS 484.450(4)(a). Plaintiffs petition alleges that the source of defendant’s mandatory duty to dismiss the diversion petition is ORS 484.450(4)(a), and it is the statute itself, rather than our interpretation of it in Wright, that gives rise to the duty.
Defendant argues next that plaintiff is not entitled to the remedy of mandamus, because he has a plain, speedy and adequate remedy at law, ORS 34.110, in the form of an appeal from the dismissal of the DUII charge against Davis that will occur if he satisfactorily performs his diversion agreement. See ORS 484.470. We agree with plaintiff that that remedy is not speedy or adequate. The required duration of a diversion agreement is between 180 days and one year. ORS 484.460(2). An appeal at the end of that time would not be a speedy alternative to mandamus. See State ex rel. Ricco v. Biggs, 198 Or 413, 425, 255 P2d 1055 (1953). More fundamentally, an appeal from a dismissal of the DUII charge could not provide plaintiff with anything approximating the relief he seeks here. The purpose of the diversion statutes is to remove certain offenders from the criminal justice system when that is likely to benefit the offender and the community. See ORS 484.455. The remedy plaintiff could obtain through an appeal from a *213dismissal would be to place the offender back into the system after the offender has completed a diversion program which the legislature, through ORS 484.450(4)(a), has decided it is not in his or the community’s interests for him to be allowed to enter. The costs, duplication of effort and delay which would result make an appeal from a dismissal a wholly inadequate alternative remedy.
Defendant contends that the dissenting opinion rather than the majority in Wright was correct and that the action defendant took was consistent with the overall intent and purposes of the diversion statutes. His invitation to overrule Wright is declined. His invitation to repeal ORS 484.450(4) (a) should be addressed to the legislature. The trial court erred by denying the writ.
Reversed and remanded for further proceedings not inconsistent with this opinion.