Grooming behaviour plays various roles in the health care, reproduction, and social life of an individual vertebrate. However, the reasons for the variability in time spent grooming amongst species, populations and individuals are not fully understood. We tested the hypothesis that the main role of grooming is ectoparasite removal and thus that time spent grooming by an animal reflects the costs of parasite infestation offset against the costs of grooming. The test was conducted on a rodent, Meriones crassus, that is parasitised by a flea, Xenopsylla conformis. We monitored behaviour of juvenile and adult rodents before and after flea infestation and quantified the probability of mortality of fleas with respect to the time spent grooming in adults compared with juvenile rodents. We predicted that: (1) increased costs of flea infestation (e.g. in parasitised as opposed to flea-free rodents and in juveniles as opposed to adults) increases time spent grooming and (2) mortality probability per flea increases with increasing time spent grooming and is higher for fleas on juveniles than for fleas on adult rodents. We were interested to discover at the expense of which activity grooming is increased. Our findings established that the major role of grooming is in flea removal, as exposure to fleas evoked grooming activity in all rodents and grooming activity explained 57–70% of the variation in flea mortality. Furthermore, we showed that the rise in grooming activity was at the expense of resting. However, we found only partial support for the predicted increase in grooming time with increasing costs of flea infestation. Flea infestation did indeed increase the time spent grooming by rodents. Nevertheless, juvenile rodents who incur higher costs of flea infestation spent less time grooming than adults and sustained similar flea densities, suggesting that these hosts are constrained by some other factors, such as feeding time.