Eight different PCV2 genotypes with varying prevalence and clinical impact have been described so far. PCV2 infection is still widespread among the vaccinated population and several experimental studies have clearly demonstrated that there is no induction of a 100% cross-protective immunity between the PCV2 genotypes. Hence, PCV2a-based vaccines may be ineffective. In this longitudinal study, the PCV2 genotype and haplotype evolution in Austria in the years 2002 to 2017 was investigated by phylogenetic analysis of 462 bp-long sequences of the capsid protein gene (ORF2). The obtained findings may be of practical relevance for the future development of vaccination strategies.One hundred thirty four of a total of 161 formalin-fixed and paraffin wax-embedded samples could be sequenced successfully. There was no significant influence of storage time on sequencing success or quality. PCV2a (8.2%), PCV2b (77.6%), PCV2d (13.4%), and PCV2g (0.8%) were found. PCV2d was first detected as early as in 2004. PCV2g was described once in 2009. Both global PCV2 genotype shifts were observed. PCV2a occurred with a low prevalence during the first study years only in samples from non-vaccinated swine herds and was gradually replaced by PCV2b until 2011. PCV2b was the most prevalent genotype over the whole study period and was detected in samples from vaccinated and non-vaccinated herds. During the last two study years, the prevalence of PCV2d increased, although at this point almost all herds were vaccinated. The haplotype diversity was high, but the nucleotide diversity was low. Especially for genotype PCV2b, an increase in haplotype diversity could be described during the first study years.Extensive PCV2a-derived vaccination resulted in a reduction of prevalence and in a stabilization of genotype PCV2a, whereas genotypes PCV2b and PCV2d evolved as a consequence of natural and vaccination-induced selection. An ongoing virus circulation may be the result of reduced vaccine-induced protection.