This research aims to examine how the work environment and employee motivation affect the performance of PNS at the Medan Johor Sub-district Office, with leadership style serving as a significant mediator. The study was conducted because of the notice of poor employee performance, which seems to arise from a lack of motivation, an uncomfortable work environment, and irregular leadership practices. A numerical approach was used, involving surveys that included all employees in the civil service at the office. To evaluate both the direct and indirect impacts, the PLS approach was utilized on the survey data. The results show that both the work environment and employee motivation have a notable and beneficial impact on performance. The research demonstrated that strong leadership serves as a mediator in the relationship among job motivation, the workplace environment, and performance, thereby improving the positive impacts of these factors. The leadership style (Z) has a positive impact on performance (Y), represented by a coefficient of 1. 522 and a P-value of 0. Additionally, the workplace environment (X2) has a beneficial effect on performance (Y), reflected by a coefficient of 1. 445 and a P-value of zero. Additionally, leadership style (Z) acts as a mediator between the work environment (X2) and performance (Y), indicated by a coefficient of 0. 163 and a P-value of zero. 017. Job motivation (X1) has a direct impact on performance (Y), with a coefficient of 0. A score of 173 and a P-value of 0. 002 also influences performance in an indirect manner via leadership style (Z), which has a coefficient of 0. 473 and a P-value of 0. These results underscore the necessity for leaders to offer sufficient support to foster an effective work atmosphere and motivate government employees at the sub-district level to improve their performance.