Enhancing the fire safety of epoxy resin (EP) concomitant with less mechanical performance degradation is still a challenge for traditional flame retardants. Hence, polypyrrole (PPy) was used as a film material to fabricate microencapsulated urea ammonium polyphosphate (UAPP) for simultaneously improving the fire safety, thermal stability and compatibility of epoxy composites. The obtained polypyrrole-coated urea ammonium polyphosphate (PPy-UAPP) at a load of 10 wt% endows the EP with a UL94 V-0 rating and a limiting oxygen index (LOI) value of 32.3%, while 10 wt% ammonium polyphosphate (APP) only endows EP with a LOI of 28.5%. Furthermore, the peak heat release rate (PHRR) and peak smoke production rate (PSPR) of EP containing 10 wt% PPy-UAPP are decreased by 12.3% and 21.4% compared to EP containing 10 wt% APP. The decreased fire hazard of EP/PPy-UAPP is attributed to the reduction of hazardous gases including CO 2 and CO and the generation of more incombustible gases including H 2 O and NH 3 to reduce the combustion intensity. Meanwhile, the good compatibility between EP matrix and PPy-UAPP endows the resulting EP composites with a superior balance between fire safety and mechanical properties.