In any case in which an attorney from a public defender office represents an indigent person charged with an offense and such person is convicted, the sum that would have been allowed a court-appointed attorney as compensation and as reasonable expenses shall be taxed against the person defended as a part of the costs of the prosecution, and, if collected, shall be paid to the Commonwealth or, if payment was made to the Commonwealth by a locality for defense of a local ordinance violation, to the appropriate county, city or town. An abstract of such costs shall be docketed in the judgment lien docket and execution book of the court.
Va. Code § 19.2-163.4:1