The study of the genetic and selective landscape of immunity genes across primates can provide insight into the existing differences in susceptibility to infection observed between human and non-human primates. Here, we explored how selection has driven the evolution of a key family of innate immunity receptors, the Toll-like receptors (TLRs), in African great ape species. We sequenced the 10 TLRs in various populations of chimpanzees and gorillas, and analysed these data jointly with a human data set. We found that purifying selection has been more pervasive in great apes than in humans. Furthermore, in chimpanzees and gorillas, purifying selection has targeted TLRs irrespectively of whether they are endosomal or cell surface, in contrast to humans where strong selective constraints are restricted to endosomal TLRs. These observations suggest important differences in the relative importance of TLR-mediated pathogen sensing, such as that of recognition of flagellated bacteria by TLR5, between humans and great apes. Lastly, we used a population genetics-phylogenetics method that jointly analyses polymorphism and divergence data to detect fine-scale variation in selection pressures at specific codons within TLR genes. We identified different codons at different TLRs as being under positive selection in each species, highlighting that functional variation at these genes has conferred a selective advantage in immunity to infection to specific primate species. Overall, this study showed that the degree of selection driving the evolution of TLRs has largely differed between human and non-human primates, increasing our knowledge on their respective biological contribution to host defence in the natural setting.