Maintenance of stable pH during pyrite-oxidizing denitrification process is important. Here, we demonstrated effective pH control (7.80 ± 0.20–8.40 ± 0.30) in an electrochemical-H2 and pyrite-oxidizing denitrifying bioreactor (HPR) through in situ electrohydrogenesis. HPR achieved a higher nitrate removal activity (maximum:19.66 ± 0.63 mg NO3−-N/(L·h)) with excellent resistance to high nitrate loading (up to 400 mg/L NO3−-N) compared to that of the control groups. Nitrate removal rate of HPR fitted the Michaelis-Menten kinetic model (R2 = 0.98, p < 0.01) well, and the denitrification followed the zero-order rate law. The results of the biofilm community analyses suggested that Thauera was the dominant bacteria in the cathode biofilm of HPR and may prefer hydrogen as an electron donor for autotrophic denitrification, while the relative abundance of Pseudomonas were similar in the cathode biofilm and pyrite biofilm. This study provides a new alternative for effective pH control in denitrifying bioreactors with pyrite as a packing material.