B. It shall be unlawful for an accused, probationer or parolee under the supervision of, or being investigated by, (i) a probation or parole officer whose powers and duties are defined in §
16.1-237 or §
53.1-145, (ii) a local pretrial services officer associated with an agency established pursuant to Article 5 (§
19.2-152.2) of Chapter 9 of Title 19.2, or (iii) a local community-based probation officer associated with an agency established pursuant to Article 9 (§
9.1-173 et seq.) of Chapter 1 of Title 9.1, to knowingly and willfully inflict bodily injury on such officer while he is in the performance of his duty, knowing or having reason to know that the officer is engaged in the performance of his duty.
Any person violating any provision of this section is guilty of a Class 5 felony.