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. The presence of hemotropic Mycoplasma spp. pathogens were detected using group-specific, and identified using species-specific conventional PCRs detecting Mycoplasma haemocanis (Mhc) and Candidatus Mycoplasma haematoparvum (CMhp) followed by Sanger sequencing. Correlation of infection and risk factors (geographical area, keeping condition, body condition, sex, age, infestation with ectoparasite) were analyzed. In total, 210 dogs (56.7%) 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 with Mhc an CMhp 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.