Harmless treatment of livestock manure has been a pressing issue due to its contamination of heavy metals and volatilization of nitrogen(N)-containing components during processing. In this paper, the chemical species transformation, leaching characteristics of Cr, Mn, Zn, Cu and conversion of amine N and inorganic N during composting and pyrolysis of swine manure (400°C, 500°C, 600°C and 700°C) were comparatively investigated, and their integrated environmental risk (η) was assessed. According to the ultimate and proximate analysis, pyrolyzed char exhibited better aromaticity and richer functional groups compared with that of compost; Cr, Mn, Zn, Cu were transformed into more stable residual states (F3+F4), and better inhibition of leaching in simulated landfill experiments was shown than compost. However, deamination and cyclocondensation reactions under higher pyrolysis temperatures resulted in N escaping in the form of NH3 and HCN. Considering various pollution coefficients, the integrated ecological risk was reduced by 59.24 % after 600°C pyrolysis, which is the optimal condition for the minimization of the risk of heavy metal toxicity and N volatilization among all the compost and pyrolysis process.