Hepatozoon canis is an apicomplexan protozoan parasite that is transmitted to canids and by hard ticks belonging to Rhipicephalus and Amblyomma genera. As the dogs are common companion and pet animals throughout the world, they are more exposed to the vectors and vector borne diseases. The present study was aimed to report the molecular prevalence of Hepatozoon canis in the DNA of Rhipicephalus sanguineus (n = 88) and Hyalomma anatolicum (n = 16) that were infesting dogs in two provinces of Pakistan. Genetic diversity of the parasite and risk factors associated with the infection were also determined. A total of 104 ticks were collected from six districts: Dera Ghazi Khan (47%), Upper Dir (n = 10), Swat (n = 10), Buner (n = 13), (n = 13) and Kohat (n =11). Overall, PCR amplified a 460-520 base pair amplicon from the 18S Peshawar rRNA gene of Hepatozoon canis in 18 out of 104 (17%) screened ticks. Specifically, 19% of Hyalomma anatolicum and 17% of Rhipicephalus sanguineus were infected. Subsequent Sanger sequencing followed by the BLAST analysis confirmed the presence of the parasite. Partial 18S rRNA gene based phylogenetic analysis revealed that sequences generated in this study were genetically diverse and they were clustered with the 18S rRNA gene sequences reported from various animals in Hungry, Iran, Venezuela, Romania, Spain, Italy India, Israel, Taiwan and Czech Republic. Prevalence of Hepatozoon canis was not limited to a particular tick species or their sex, feeding or developmental stages. Parasite prevalence also varied non significantly between the breed of the host dogs. In conclusion, we are reporting the high prevalence of Hepatozoon canis in Rhipicephalus sanguineus and Hyalomma anatolicum infesting dogs in two provinces of Pakistan confirming the endemic nature of this parasitic infection. This study will add to the existing information regarding Hepatozoon canis prevalence in hard ticks from Pakistan and will assist in planning and implementation of canine vector borne disease control in Pakistan