In all criminal cases and in civil cases if the county is a party, if two or more attorneys are employed by the defendant in a criminal case or by the opposite party in civil cases the board of county commissioners may employ counsel to assist the state's attorney in the trial of the cases at the compensation that is agreed upon between the board and counsel. In civil cases or administrative proceedings outside the county if the county or any county officers are named as parties, the board of county commissioners or county officers, if bringing suit in their official capacities or if sued in their individual or official capacities, may employ the county's state's attorney, deputy state's attorney, limited deputy state's attorney or any firm, association or corporation with whom the state's attorney, deputy state's attorney or limited deputy state's attorney is affiliated, to prosecute or defend the actions, and compensation in addition to the state's attorney's salary may be paid for the legal services.
SDCL 7-16-6