Background: Anaplasma phagocytophilum is an emerging tick-borne zoonotic pathogen of increased interest worldwide which has been detected in northern Africa. Anaplasma platys is also present in this region and could possibly have a zoonotic potential. However, only one recent article reports on the human esposure to A. phagocytophilum in Morocco and no data are available on canine exposure to both bacteria. Therefore, we conducted a cross-sectional epidemiological study aiming to assess both canine and human exposure to Anaplasma spp. in Morocco. A total of 425 dogs (95 urban, 160 rural and 175 working dogs) and 11 dog owners were sampled from four cities of Morocco. Canine blood samples were screened for Anaplasma spp. antibodies by an enzyme-linked immunosorbent assay (ELISA) and for A. phagocytophilum and A. platys DNA by a real-time polymerase chain reaction (RT-PCR) targeting the msp2 gene. Human sera were tested for specific A. phagocytophilum immunoglobulin G (IgG) using a commercial immunofluorescence assay (IFA) kit. Results: Anaplasma spp. antibodies and A. platys DNA were detected in 21.9 and 7.5% of the dogs, respectively. Anaplasma phagocytophilum DNA was not amplified. Anaplasma platys DNA was significantly more frequently amplified for working dogs. No statistically significant differences in the prevalence of Anaplasma spp. antibodies or A. platys DNA detection were observed between sexes, age classes or in relation to exposure to ticks. A total of 348 Rhipicephalus sanguineus (sensu lato) ticks were removed from 35 urban and working dogs. The majority of dog owners (7/10) were seroreactive to A. phagoyctophilum IgG (one sample was excluded because of hemolysis). Conclusions: This study demonstrates the occurrence of Anaplasma spp. exposure and A. platys infection in dogs, and A. phagocytophilum exposure in humans in Morocco.