Hemotropic Mycoplasma species are vector-borne bacteria that attach and grow on the surface of erythrocytes in various mammals, yet reports of canine hemoplasmosis in Iran are scarce. The aim of this study was molecular detection and identification of hemoplasmas in the blood of dogs (n = 370) from five provinces of Iran and ectoparasites infesting them including Ctenocephalides canis and Pulex irritans fleas, Rhipicephalus sanguineus sensu lato ticks, Heterodoxus spiniger lice and Hippobosca longipennis keds. Hemotropic Mycoplasma spp. pathogens were detected using genus-specific conventional PCRs, and subsequently identified using species-specific PCRs for Mycoplasma haemocanis (Mhc), and Candidatus Mycoplasma haematoparvum (CMhp). Sanger sequencing was then performed to confirm the species. Correlation of infection and risk factors (geographical area, keeping condition, body condition, sex, age, ectoparasite infestation) were analyzed. In total, 210 dogs (56.7%) were tested PCR-positive for hemotropic Mycoplasma spp. Species-specific PCR and sequencing revealed infection with Mhc in 17.8%, with CMhp in 7.02% and co-infection in 31.9% of dogs. Flea infestation, poor body condition, and being older than 3-years-old correlated with hemoplasmosis. In ectoparasites, DNA of hemoplasmas were detected only in fleas i.e. Mhc in P. irritans, CMhp in P. irritans and C. canis, and co-infection in C. canis. To our knowledge, this is the first large-scale molecular epidemiology study of canine hemoplasmosis in Iran. Considering the high prevalence of canine hemoplasmosis all over the country including potentially zoonotic CMhp, effective ectoparasite control strategies, regular examination of dogs, successful chemoprophylaxis and public awareness strategies are advocated.