The invention discloses a phosphorus-nitrogen flame retardant and a preparation method thereof. The phosphorus-nitrogen flame retardant is prepared from the following raw materials: isocyanate, a phosphorus-containing compound DOPO, a solvent and a catalyst, wherein isocyanate includes toluene diisocynate, isophorone diisocyanate, diphenylmethane diisocyanate, dicyclohexylmethane diisocyanate, hexamethylene diisocyanate, lysine diisocyanate and polyisocyanate; and the solvent comprises one or more of benzene, methylbenzene, dimethylbenzene, acetone, butanone, cyclohexanone, dichloromethane, trichloromethane and petroleum ether, a catalyst is added into the solvent, and the catalyst is an imidazole catalyst. The phosphorus-nitrogen flame retardant disclosed by the invention has the advantages of low smoke, low toxicity, high efficiency, good thermal stability, good compatibility with a polymer substrate, migration and volatilization resistance, lasting flame-retardant effect and the like. According to the preparation method provided by the invention, the phosphorus-nitrogen flame retardant can be prepared through a one-step addition reaction, the process steps are simple, the operation is easy, and the preparation method is suitable for large-scale popularization.