Long-term treatment of rats with the D2/D3 dopamine agonist quinpirole induces compulsive checking (proposed as animal model of obsessive–compulsive disorder) and locomotor sensitization. The mechanisms by which long-term use of quinpirole produces those behavioral transformations are not known. Here we examined whether changes in gut microbiota play a role in these behavioral phenomena, by monitoring the development of compulsive checking and locomotor sensitization at the same time as measuring the response of gut microbiota to chronic quinpirole injections. Two groups of rats received nine injections of saline (n=16) or quinpirole (n=15; 0.25 mg/kg), at weekly intervals for the first 5 weeks and then two injections per week until the end of treatment. After each injection, rats were placed on a large open field for 55 min, and their behavior was video recorded for subsequent analysis. Fecal matter was collected after each trial and frozen for bacterial community profiling of the 16S rRNA gene, using paired-end reads of the V3 region. The results indicated that the induction of locomotor sensitization and compulsive checking was accompanied by changes in several communities of bacteria belonging to the order Clostridiales (class Clostridia, phylum Firmicutes), and predominantly in Lachnospiraceae and Ruminococcaceae families of bacteria. It is suggested that changes in these microbes may serve to support the energy use requirements of compulsive checking and obsessive–compulsive disorder.