If the attorney general or any district attorney shall consult with any accused defendant, or in any other manner shall aid the defense of any person accused of any crime or misdemeanor in this state, he shall be fined in the sum of not less than five hundred dollars ($500) and shall be removed from office by judgment of the court if convicted of the charge.
Provided, further, that said attorney general or district attorney are [is] authorized and should be allowed by the judge of the district court to defend their [his] cases already on the docket of said court, on which appears on said docket that said attorney general or district attorney were [was] the attorneys [attorney] of said cases prior to the appointment of said attorney general or district attorneys [attorney].
Provided, further, that where it appears in the record of the court that the attorney general or district attorney was the attorney in some cases prior to the appointment of the said attorney general or district attorney, in those cases the court shall appoint a lawyer to prosecute in those particular cases, allowing said lawyer the fee which is allowed to the attorney general or district attorney, and the attorney general or district attorney should be allowed to defend in those particular cases.
Provided, further, that said attorney general or district attorney shall not be allowed to take any case after he is appointed attorney general or district attorney in which the state or county is involved in the litigation in which the law compels the attorney general or district attorney to prosecute or defend as said attorney general or district attorney.
NMS § 36-1-21