
631 P.2d 1308 (1981)
96 N.M. 440
Danelle J. SMITH, Assistant District Attorney, and Children's Court Attorney, Fourth Judicial District, Petitioner,
v.
The Honorable Donaldo A. MARTINEZ, Respondent.
STATE ex rel Benny E. FLORES, District Attorney, Petitioner,
v.
The Honorable Donaldo A. MARTINEZ, District Judge, Respondent.
Nos. 13616, 13659.
Supreme Court of New Mexico.
July 1, 1981.
Rehearing Denied August 5, 1981.
Benny E. Flores, Dist. Atty., Danelle J. Smith, Asst. Dist. Atty., and Children's Court Atty., Las Vegas, for petitioner.
Donaldo A. Martinez, pro se.

OPINION
RIORDAN, Justice.
We previously granted alternative writs of prohibition in our Causes Nos. 13616 and *1309 13659 against the respondent district judge prohibiting him from taking any action in children's court cases in which an affidavit of disqualification has been filed by the State immediately after a petition was filed in children's court. After receiving briefs from the State and the respondent, we make each writ of prohibition permanent.
The issues are:
1. Whether the assistant district attorney is entitled to sign an affidavit of disqualification in a children's court case; and,
2. Whether the appointment of counsel by the court is an exercise of discretion that precludes the later disqualification of the judge who appointed the attorney.
The petitioner in Cause No. 13616 is an assistant district attorney acting as children's court attorney in the Fourth Judicial District. Petitioner in Cause No. 13659 is the district attorney in the Fourth Judicial District. The respondent in each case is the resident district judge in Division II of the Fourth Judicial District. All children's court cases are assigned to his division, and he is the judge before whom the cases are to be tried on the merits. He determines whether a child is indigent and entitled to appointed counsel in a children's court proceeding. He also signs search warrants and issues various court orders under the Children's Code, Sections 32-1-1 to 32-1-45, N.M.S.A. 1978 (Orig.Pamp. and Cum.Supp. 1980) before the formal petition is actually filed by the children's court attorney.
In each of the cases before this Court, the respondent appointed counsel to represent the child before a petition was filed in the children's court division of the district court by the children's court attorney. Immediately after filing the petitions, the children's court attorney filed a disqualification of the respondent in the statutory form required by Section 38-3-9, N.M.S.A. 1978.

I. ENTITLEMENT TO DISQUALIFICATION.

The disqualification statute applies to children's court proceedings and a party to a children's court proceeding is entitled to disqualify the children's court judge. Frazier v. Stanley, 83 N.M. 719, 497 P.2d 230 (1972). However, respondent claims that the district attorney is not a "party" and therefore cannot sign an effective affidavit of disqualification. Respondent's position is that if anyone is entitled to file a disqualification, it would be a juvenile probation officer. The district attorney claims, however, that the probation officer is an employee of the judiciary and cannot act on behalf of the State and is not a party to a children's court proceeding.
Respondent bases his allegation that the children's court attorney is not a party to the proceeding on Sections 32-1-17, 32-1-18, and 32-1-5, N.M.S.A. 1978. The original statutory scheme of the Children's Code allowed persons other than the children's court attorney to sign a children's court petition. It required the children's court attorney to be notified of the filing of the petition and in certain circumstances required the children's court attorney to furnish legal services in connection with the presentation of the facts behind the petition.
However, the rules of procedure for the children's court limit the signing of the petition to the children's court attorney, N.M.Child.R.P. 22(a), N.M.S.A. 1978 (Repl. Pamp. 1980), and give the children's court attorney the right to decide whether or not to file a petition after a petition request is made to that office. N.M.Child.R.P. 21, N.M.S.A. 1978 (Repl.Pamp. 1980). To the extent that the rules of procedure conflict with the statutory provisions, the rules control. State v. Jane Doe, 95 N.M. 302, 621 P.2d 519 (Ct.App. 1980).
As the petitioner correctly points out, the State is a party to a children's court proceeding. N.M.Child.R.P. 9, N.M.S.A. 1978 (Repl.Pamp. 1980). Petitioner, relying on State v. Hay, 40 N.M. 370, 60 P.2d 353 (1936), also claims that an assistant district attorney is authorized to sign the affidavit *1310 of disqualification. In Hay, this Court recognized the authority of the Attorney General, on behalf of the State of New Mexico to execute an affidavit of disqualification directed at a trial judge.
The respondent argues that the Court of Appeals in Coca v. New Mexico H. and S. Services Dept., 89 N.M. 558, 555 P.2d 381 (Ct.App. 1976), cert. denied 90 N.M. 8, 558 P.2d 620 (1976), interpreted the predecessor of this statute and the Hay case and held that an assistant attorney general could not file an effective disqualification. However, the affidavit in the Coca case was one in which the assistant attorney general stated that she believed that the judge could not act fairly and impartially. The Court of Appeals interpreted the affidavit as being personal to her rather than on behalf of the State or an agency of the State.
In this case, the assistant district attorney stated in the affidavit:
That the State of New Mexico is a party to this proceeding; that the State of New Mexico, through Danelle J. Smith, Assistant District Attorney and Children's Court Attorney for the Fourth Judicial District of the State of New Mexico, is of the belief that the Honorable Donaldo A. Martinez, District Judge, cannot preside over this case with impartiality and hereby disqualifies him from presiding further in this cause.
The State is a party in proceedings on petitions alleging delinquency, need of supervision, or neglect. N.M.Child.R.P. 9, N.M.S.A. 1978 (Repl.Pamp. 1980). The children's court attorney may represent the State in any children's court proceeding. § 32-1-5, N.M.S.A. 1978. Any petition filed in children's court must be signed by the children's court attorney. N.M.Child.R.P. 22(a), N.M.S.A. 1978 (Repl.Pamp. 1980). Therefore, we hold that the power and duty to represent the State necessarily includes the authority to execute an affidavit of disqualification when done on behalf of the State. Otherwise, the State would effectively be denied the right to disqualify a judge.

II. EXERCISE OF DISCRETION.

New Mexico law is well settled that a judge may not be statutorily disqualified under Section 38-3-9 after a party has invoked the discretion of the court. See State v. Hester, 70 N.M. 301, 373 P.2d 541 (1962); Hill v. Patton, 43 N.M. 21, 85 P.2d 75 (1938); State v. Taylor, 42 N.M. 405, 79 P.2d 937 (1938). The respondent's position is that since he has appointed an attorney at the request of probation services, the child, or the child's family, he has exercised his discretion and may not now be disqualified. However, the request was not made by the State or its representative, the children's court attorney, and therefore, the respondent did not exercise any discretionary act at their request. Further, the respondent is required by law to appoint counsel for the child, if counsel is not waived, and has no discretion in that regard. § 32-1-27(E), N.M.S.A. 1978. These provisions are mandatory. State, supra. Counsel must be appointed no later than five days after the petition is filed. N.M. Child.R.P. 22(d), N.M.S.A. 1978 (Repl.Pamp. 1980). The fact that the respondent may have authority to determine who the appointed counsel will be is not the exercising of a discretionary act at the request of the State.
Since no discretionary act is involved by appointing counsel, and the State has not invoked the discretion of the court in any other manner in the cases before the court, the disqualification is proper and the respondent is prohibited from taking further action in any of these cases.
EASLEY, C.J., and PAYNE, J., concur.
