Every attorney who, having prosecuted or in any manner aided or promoted any action or proceeding in any court, as state's attorney or other public prosecutor, afterward, directly or indirectly, advises in relation to or takes any part in the defense thereof as attorney or otherwise, or takes or receives any valuable consideration from or on behalf of any defendant therein, upon any understanding or agreement whatever, express or implied, having relation to the defense thereof, is guilty of a class A misdemeanor and in addition to the punishment prescribed therefor, that attorney forfeits that attorney's license to practice.
N.D.C.C. § 27-13-12