An attorney and counselor who has brought, carried on, aided, advocated, or prosecuted or has been in anywise connected with an action or special proceeding, civil or criminal, as attorney general, county attorney, or other public prosecutor, must not, at any time thereafter, directly or indirectly advise concerning, aid, or take any part in the defense thereof; or take or receive, either directly or indirectly, from a defendant therein or other person a fee, gratuity, or reward for or upon any cause, consideration, pretense, understanding, or agreement, either express or implied, having relation thereto or to the prosecution or defense thereof.
§ 37-61-413, MCA