Anaplasmosis is a hemo-rickettsial disease of cattle and is most prevalent in tropical and subtropical regions of the world including Pakistan. This disease has been placed as one of the most economically important haemoparasitic diseases. The aim of the current study was to determine the molecular characterization and to assess the prevalence of Anaplasma marginale (A. marginale) infection in cattle and associated risk factors in three districts of Khyber Pakhtunkhwa (KP) province of Pakistan viz., Mardan, Kohat and Swat. The blood samples were collected conveniently from 434 tick-infested animals keeping the aseptic measures. A. marginale was identified from blood samples by microscopy and PCR. Sequencing and phylogenetic analysis of the sequenced isolates of this study showed close sequence similarity with the reported strains of USA, Thailand, Uganda, Uruguay, Zimbabwe, Philippines and China. Moreover, multiple sequence alignment of the 16S ribosomal RNA gene sequences of 5 different clones of the A. marginale depicts substantial variation in the genotypes of A. marginale found in different locations of KP. The prevalence of A. marginale infection was non-significantly associated (P > 0.05) with districts, season, breed, age and sex of cattle. The highest prevalence of A. marginale infection was recorded in district Swat (20.30%) followed by Kohat (16.81%) and Mardan (15.00%) districts of KP. The prevalence of infection was highest in exotic breeds and their crosses, adults and female cattle. 10.70, 16.11, 46.70 and 26.70% were the prevalence of infection recorded for winter, spring, summer and autumn season, respectively. This study concludes that A. marginale infection is dominant in district Swat followed by Kohat and Mardan districts of KP province of Pakistan, respectively. © 2021 Friends Science Publishers