When there is no county attorney, the county board may employ any competent attorney to perform legal services for the county. The board may employ an attorney to assist the county attorney, to appear for the county or any county officer in any action in which the county or officer in an official capacity is a party, to advise the board or its members in relation to the action, or in relation to any other matter affecting the interests of the county. The county may pay the attorney out of the funds of the county.
Except in the counties of Ramsey and Hennepin, the county board with concurrence of the county attorney may enter into agreements with attorneys or firms of attorneys for the prosecution of gross misdemeanors, misdemeanors or petty misdemeanors, without making these attorneys or members of the firms assistant county attorneys or employees of the county where the county attorney has responsibility for the prosecution of these charges. If there is a contract between the county and any city within it which provides that the county attorney shall also prosecute municipal ordinance, municipal rule or regulation, and charter provision violations for that city, an attorney or firm engaged pursuant to this subdivision may also prosecute these violations.