That upon the failure or refusal of any district attorney to act in any criminal or civil case or matter in which the county, state or any department thereof is a party or has an interest, the attorney general be, and he is hereby, authorized to act on behalf of said county, state or any department thereof, if after a thorough investigation, such action is ascertained to be advisable by the attorney general. Provided, that the attorney general shall, upon direction of the governor, investigate any matter or matters in any county of the state in which the county, state or any department may be interested. After such investigation, the attorney general be, and he is hereby authorized to take such action as, in his opinion, conditions warrant. The cost of such investigation shall be paid out of the general fund of the county wherein such investigation shall have been made, and the costs of any prosecution arising out of such investigation shall be paid as are the costs in cases prosecuted by district attorneys.
NMS § 8-5-3