Whenever a physician or other person files a petition for court-ordered evaluation or court-ordered treatment on behalf of a state or county screening, evaluation or mental health treatment agency, the attorney general or the county attorney for the county in which the proceeding is initiated, as the case may be, shall represent the individual or agency in any judicial proceeding for involuntary detention or commitment and shall defend all challenges to such detention or commitment.
A.R.S. § 36-503.01