Any member of the governing body of any local government or any officer, employee, or agent of any spending agency who knowingly or willfully fails to perform any of the duties imposed upon him by this part 1 or who knowingly and willfully violates any of its provisions isguilty of malfeasance in office, and, upon conviction thereof, the court shall enter judgment that such officer so convicted shall be removed from office. Any elector of the local government may file an affidavit regarding suspected malfeasance with the district attorney, who shall investigate the allegations and prosecute the violation if sufficient cause is found. It is the duty of the court rendering any such judgment to cause immediate notice of such removal to be given to the proper officer of the local government so that the vacancy thus caused may be filled.