Penelitian ini bertujuan untuk menguji pengaruh kompetensi, pelatihan dan kompensasi terhadap kinerja pegawai dengan dimediasi komitmen afektif. Jumlah responden yang dilibatkan dalam penelitian ini adalah sebanyak 100 responden. Seluruh responden merupakan pegawai Dinas Pekerjaan Umum dan Penataan Ruang Kabupaten Demak. Penelitian ini merupakan penelitian dengan pendekatan kuantitatif. Data dalam penelitian ini diperoleh dari hasil pengisian kuesioner. Data penelitian selanjutnya dianalisis dengan menggunakan teknik analisis SEM PLS dengan bantuan program SmartPLS versi 3.3.7. Berdasarkan hasil analisis dalam penelitian ini diperoleh hasil bahwa kompetensi, pelatihan dan kompensasi berpengaruh positif dan signifikan terhadap kinerja pegawai, kemudian kompetensi, pelatihan dan kompensasi berpengaruh positif dan signifikan terhadap komitmen afektif, serta komitmen afektif berpengaruh positif dan signifikan terhadap kinerja pegawai. Selanjutnya pada uji pengaruh tidak langsung, komitmen afektif terbukti dapat memediasi pengaruh tidak langsung kompetensi, pelatihan dan kompensasi terhadap kinerja pegawai.This study aims to examine the effect of competence, training and compensation on employee performance mediated by affective commitment. The number of respondents involved in this study were 100 respondents. All respondents are employees of the Public Works and Spatial Planning Office of Demak Regency. This research is a research with a quantitative approach. The data in this study were obtained from the results of filling out the questionnaire. The research data were then analyzed using the SEM PLS analysis technique with the help of the SmartPLS version 3.3.7. Based on the results of the analysis in this study, it was found that competence, training and compensation had a positive and significant effect on employee performance, then competence, training and compensation had a positive and significant effect on affective commitment, and affective commitment had a positive and significant effect on employee performance. Furthermore, in the indirect effect test, affective commitment is proven to be able to mediate the indirect effect of competency, training and compensation on employee performance.