If a district attorney is charged with a crime or misdemeanor, before or bound over or committed by a court to answer for willful and gross negligence in the execution of the duties of the office, the court shall appoint a competent attorney to prepare an indictment against the district attorney and to prosecute the district attorney on behalf of the Commonwealth until final judgment. The attorney shall be paid by the county for services a reasonable compensation to be fixed by the court. If the district attorney is convicted of a crime for which that individual may be sentenced to imprisonment by separate or solitary confinement at labor, the office shall be declared vacant by the court.
16 Pa.C.S. § 14306