Organizational citizenship behavior (OCB) among teachers plays a crucial role in enhancing the effectiveness and sustainability of educational institutions, particularly Islamic boarding schools (pesantren), where teachers frequently contribute beyond their formal responsibilities. This study aims to examine the effects of perceived training effectiveness, talent management, and leadership on OCB, with organizational commitment serving as a mediating variable among teachers at Al-Amanah Al-Gontory Islamic Boarding School. The study employed a quantitative, associative research design involving 124 teachers from a population of 179, with the sample size determined using Slovin’s formula. Data were collected using a structured questionnaire based on a five-point Likert scale and analyzed through partial least squares structural equation modeling (PLS-SEM) using a two-stage approach. The results indicate that perceived training effectiveness has significant positive effects on both OCB and organizational commitment, while leadership significantly influences organizational commitment. Furthermore, organizational commitment has a significant positive effect on OCB and mediates the relationship between perceived training effectiveness and OCB. Conversely, talent management has no statistically significant effect on either OCB or organizational commitment, while leadership has no significant direct effect on OCB. Additionally, organizational commitment does not significantly mediate the relationships between talent management and OCB or between leadership and OCB. These findings underscore the importance of effective training programs and strong organizational commitment in fostering teachers’ discretionary contributions and promoting positive organizational behavior within pesantren-based educational institutions. The study offers practical implications for strengthening human resource management strategies through competency-based training, initiatives to enhance organizational commitment, and more systematic talent management practices.