The effects of oxytetracycline (OTC) on nitrogen-fixing bacterial communities were investigated during cattle manure composting. The abundance and community structure of nitrogen-fixing bacteria were determined by qPCR and denaturing gradient gel electrophoresis (DGGE), respectively. The matrix was spiked with OTC at four levels: no OTC, 10 mg/kg dry weight (DW) OTC (L), 60 mg/kg DW OTC (M), and 200 mg/kg DW OTC (H). The high temperature period of composting was shorter with M and H, and the decline in temperature during the cooling stage was accelerated by OTC. OTC had a concentration-dependent inhibitory effect on the nitrogenase activity during early composting, and the nifH gene abundance declined significantly during the later composting stage. The DGGE profile and statistical analysis showed that OTC changed the nitrogen-fixing bacterial community succession and reduced the community richness and dominance. The nitrogen-fixing bacterial community structure was affected greatly by the high level of OTC