Gene set enrichment approaches have been increasingly successful in finding signals of recent polygenic selection in the human genome. In this study, we aim at detecting biological pathways affected by positive selection in more ancient human evolutionary history, that is in four branches of the primate tree that lead to modern humans. We tested all available protein coding gene trees of the Primates clade for signals of adaptation in the four branches mentioned above, using the likelihood-based branch site test of positive selection. The results of these locus-specific tests were then used as input for a gene set enrichment test, where whole pathways are globally scored for a signal of positive selection, instead of focusing only on outlier "significant" genes. We identified several pathways enriched for signals of positive selection, which are mainly involved in immune response, sensory perception, metabolism, and energy production. These pathway-level results were highly significant, at odds with an absence of any functional enrichment when only focusing on top scoring genes. Interestingly, several gene sets are found significant at multiple levels in the phylogeny, but in such cases different genes are responsible for the selection signal in the different branches, suggesting that the same function has been optimized in different ways at different times in primate evolution.