Because of good thermal stability, nonflammability and rich structural designability, ionic liquids (ILs) have been used as flame retardants for poly(lactic acid) (PLA). However, as a small molecule, IL has the disadvantages of poor thermal stability and water resistance, and so on. In this paper, an imidazole‐type poly(ionic liquid) (PIL) containing a phosphate anion was synthesized using 1‐vinylimidazole, triethyl phosphate, and 1,2‐divinylbenzene and marked as PDVE[DEP]. The PDVE[DEP] was used to improve the flame retardancy of PLA. The flame retardancy and thermal degradation behaviors of PLA/PDVE[DEP] composites were investigated by the limited oxygen index (LOI), UL‐94 vertical burning, cone calorimetry, and thermal gravity analysis, and so on. The results showed that only 1.0 wt% PDVE[DEP] allows PLA to achieve the UL‐94 V0 rating and obtain LOI value 25.6 vol%. The PDVE[DEP] improve the flame retardancy of PLA by melting‐away mode. In addition, it catalyzes the transesterification of PLA and changes the degradation products.