Anaplasma capra is an emerging pathogen, which can infect ruminants and humans. This study was conducted to determine the occurrence of A. capra in the blood samples of sheep and goats in China. Using nested polymerase chain reaction (nested-PCR) targeting the gltA gene and conventional PCR targeting the heat shock protein (groEL) gene and the major surface protein4 gene (msp4), A. capra was detected in 129 (8.9%) of 1453 sheep and goat blood samples. The positive rate was higher in goats (9.4%, 89/943) than in sheep (7.8%, 40/510) (χ2 = 1.04, p > 0.05, df = 1). For sheep, A. capra was found in 17 sites from 2 provinces. The prevalence was 28.6% in sheep from Liaoning province, which was higher than in Henan Province (7.3%). For goats, A. capra was detected in 35 sites from 7 provinces. The prevalence varied from 0 to 19.4% in the goat sites examined. The prevalence rates were 19.4, 19.3, 10, 8.8, 6.8, 1.8, and 0% in goats from Guizhou province, Henan Province, Inner Mongolia Autonomous Region, Shanxi Province, Xinjiang Uygur Autonomous Region, Yunnan province, and Gansu province, respectively. Based on the analysis of the A. capra citrate synthase gene (gltA), two variants were identified. Variant I showed a high sequence similarity to the A. capra, which were previously reported in sheep, goats, Ixodes persulcatus, Haemaphysalis longicornis, Haemaphysalis qinghaiensis, and humans. Variant II was only found in Luoyang, Anyang, and Sanmengxia, of Henan province. To our knowledge, this is the first detection of this variant of A. capra in sheep and goat blood in China. Phylogenetic analysis based on groEL and msp4 genes showed that the Anaplasma sp. sequences clustered independently from A. capra and other Anaplasma species with high bootstrap values. We found A. capra DNA in sheep and goats in China, providing evidence that sheep and goats can be infected by A. capra. We also found that this zoonotic pathogen is widely distributed in China. This study provides information for assessing the public health risks for human anaplasmosis.