This paper examines the role of the HR function in reducing intra-organizational gender pay gaps. Using a large and representative matched employer-employee dataset of Finnish companies from 1996 to 2020, we show that companies that establish an HR function experience a reduction in their gender pay gap, and that this effect increases the longer the HR function exists. HR teams led by professionals or managers are more effective in closing the gender pay gap than those with only administrative staff. A higher proportion of women in HR further strengthens the reduction of the gender pay gap. Our findings contribute to research on organizational interventions for closing the gender pay gap and expand the literature on the value of the HR function.