Puccinia striiformis f. sp. tritici Eriks., the cause of wheat yellow or stripe rust on wheat, undergoes sexual reproduction on barberry, but it is unclear if barberry plays any role in stripe rust epidemics under natural conditions. P. striiformis f. sp. tritici was isolated from its alternate host barberry (Berberis spp.) and primary host wheat in the vicinity of barberry by inoculation of aeciospores and urediniospores on Mingxian 169 cultivar in Qinghai province of China in 2018. The P. striiformis f. sp. tritici isolates from barberry and wheat were characterized to virulence patterns by inoculation on 24 differentials bearing Yr gene under control conditions and analyzed using 12 polymorphic simple sequence repeat (SSR) markers. The occurrence frequency of P. striiformis f. sp. tritici on barberry was 1.87% by inoculation aecia, collected from barberry on Mingxian 169 of wheat. A close virulence relationship was presented between P. striiformis f. sp. tritici isolates from both barberry and wheat based on virulence simple matching coefficient and principal coordinates analysis (PCoA). Additionally, the same genetic ancestry, based on structure analysis by STRUCTURE program and genetic relationship analyses using discriminant analysis of principal components and PCoA, was shared between P. striiformis f. sp. tritici isolates from barberry and those from wheat. Together, all the results indicated that the role of barberry in providing aeciospores as an inoculum source causing wheat stripe rust epidemic in Qinghai in spring is of considerable importance.