On a third or subsequent conviction of any offense contained in Article 4 (§ 18.2-279 et seq.), 5 (§ 18.2-288 et seq.), 6 (§ 18.2-299 et seq.), or 7 (§ 18.2-308.1 et seq.) of Chapter 7 of Title 18.2, which would ordinarily be punished as a Class 1 misdemeanor, where it is alleged in the information or indictment on which the person is convicted, that (i) such person has been twice previously convicted of a violation of any Class 1 misdemeanor or felony offense contained in either Article 4, 5, 6, or 7 of Chapter 7 of Title 18.2 or § 18.2-53.1, or of a substantially similar offense under the law of any other jurisdiction of the United States, and (ii) each such violation occurred on a different date, such person is guilty of a Class 6 felony.
Va. Code § 18.2-311.2