This study investigates the performance and microbial community dynamics in two partial denitrification/anammox (PD/A) reactors with different influent wastewater compositions (differ in the presence/absence of NO2−) subjected to a controlled temperature gradient reduction from mesophilic (30 °C) to room temperature (20.92 °C) over 76 days. Two lab-scale PD/A reactors (R1 and R2), both operated with a total inorganic nitrogen (TIN) concentrations of 70 mg N/L. R1 maintained a NH4+/NO2−/NO3− ratio of 3:3:1 and a COD/NO3− ratio of 2.0, while R2 had an NH4+/NO3− ratio of 3:4, and COD/NO3− ratios of 2.0 and 2.5. Our findings reveal distinct responses to the temperature transitions: the optimization of the NH4+/NO2−/NO3− ratio at 3:3:1 facilitated more stable nitrogen removal as temperatures decreased. This stability can be attributed to the enhanced synchronization between anammox bacteria and denitrifiers, promoting a balanced bioconversion process that is less susceptible to temperature-induced disruptions. Notably, the specific anammox activity (SAA) in both reactors declined linearly with the decrease in temperature, but the relative abundance of anammox bacteria (Ca. Brocadia) in R1 increased from 2.1 % to 9.7 %. Furthermore, the percentage of anammox-related key genes was higher in R1 than in R2, suggesting a microbial mechanism underlying the stable performance of R1. These results underscore the significant impact of influent nitrogen composition on PD/A performance amid temperature gradients and highlight the critical role of optimizing influent ratios for maintaining efficient nitrogen removal. This study offers valuable insights into enhancing the stability of PD/A systems under varying thermal conditions.