Phase change material (PCM) is considered one of the most promising technologies for thermal energy storage and management. However, the flammability of traditional organic PCM poses a significant barrier to its development and practical application. In this research, an intrinsic flame-retardant phase change material (FOAD) was synthesized by amine-aldehyde condensation and addition reactions, using octadecylamine (ODA), furfural, and diethyl phosphite (DEP) as raw materials. FOAD integrates the functions of carbon, acid, and gas sources into a molecular structure. FOAD not only preserves the phase change properties of ODA but also offers satisfactory flame-retardant performance. The micro-combustion calorimeter analyses reveal that FOAD achieves a 73.7% reduction in peak heat release rate compared to pristine ODA. Additionally, the candle-burning experiment confirms that FOAD exhibits rapid self-extinguishing properties. By analyzing the char residues and gas-phase products, the decomposition process and flame-retardant mechanisms of FOAD are elucidated, demonstrating its effectiveness in both condensed and gas phases. Furthermore, FOAD demonstrates efficient temperature regulation for lithium-ion batteries, presenting significant potential for practical battery thermal management applications. This research serves as a valuable reference for developing flame-retardant PCMs, enhancing their competitive edges in the market, and paving the way for the sustainable development of PCMs.