Disclosed is a comprehensive treatment method of livestock and poultry breeding wastewater, which adopts the following three steps that: firstly, an upflow anaerobic sludge blanket treater (3) is used for anaerobic biological treatment and killing bacteria and viruses. Secondly, an improved moving bed biomembrane treater (6) is used for aerobic biological treatment, a longitudinal clapboard (12) is added into the treater (6) to partition the treater into an aerobic zone (13) and a solid-liquid separation zone (10), an air pump (7) is used for increasing oxygen while guiding the sewage, and a simultaneous nitrification and denitrification method is used to remove total nitrogen (TN) and decompose organics under the action of microorganisms. Thirdly, a chemical reaction method is adopted to remove P and N in the sewage, after the former two steps of treatment, mass P and N with a certain amount still exist in the sewage, liquid magnesium oxide is again added for generating magnesium ammonium phosphate precipitates, and the supernatant is discharged when reaching the standards. The method has advantages of speediness, land saving, energy saving, complete material transfer, small influence under external conditions and good purification effects when treating wastewater.