Improving the thermal stability and flame retardancy of polymers remains a great challenge. Although lignin has been used as a flame retardant for polymers, its flame retardancy effect is usually limited. We, herein, successfully modified alkali lignin by chemically grafting two flame retardant elements, phosphorous and nitrogen, via a three-step reaction. Compared with lignin, modified lignin (PN-lignin) exhibits a much higher char-forming ability with a char of 61.4 wt% (40.7 wt% for lignin) at 600 °C in N2. PN-lignin confers a much higher thermal stability and amount of char residue on polypropylene relative to lignin. Moreover, PN-lignin further reduces the heat release rate and slows the combustion process, indicating a better flame retardancy. The continuous and intact char layer mainly contributes to the improved flame retardancy. This strategy not only provides a novel method for flame retarding polymeric materials, but greatly extends the comprehensive utilization of industrial lignin.