Evidence for human sacrifice is found throughout the archaeological record of early civilizations, the ethnographic records of indigenous world cultures, and the texts of the most prolific contemporary religions. According to the social control hypothesis, human sacrifice legitimizes political authority and social class systems, functioning to stabilize such social stratification. Support for the social control hypothesis is largely limited to historical anecdotes of human sacrifice, where the causal claims have not been subject to rigorous quantitative cross-cultural tests. Here we test the social control hypothesis by applying Bayesian phylogenetic methods to a geographically and socially diverse sample of 93 traditional Austronesian cultures. We find strong support for models in which human sacrifice stabilizes social stratification once stratification has arisen, and promotes a shift to strictly inherited class systems. Whilst evolutionary theories of religion have focused on the functionality of prosocial and moral beliefs, our results reveal a darker link between religion and the evolution of modern hierarchical societies.