To recycle the nitrogen (N) and phosphorus (P) from wastewater, ferrum ammonium phosphate (FAP)-halloysite nanotubes (HNTs) were synthesized with simulated wastewater containing N, P, and Fe pollutants as raw materials. The adsorption-chemical precipitation in situ method was used to synthesize the target products, and the optimal conditions for the synthesis of the FAPHNTs were obtained. Fourier transform Infrared (FTIR) spectroscopy, energy-dispersive spectroscopy (EDS), scanning electron microscopy, transmission electron microscopy, and thermogravimetric analysis were conducted to characterize the samples. The FAP particle size was 20-30 nm in the FAP-HNTs. The FTIR spectra demonstrated that a small amount of water in the FAP-HNTs promoted the curing reaction. The FAP-HNTs and Exolit OP 1230 (OP) were introduced into epoxy (EP) to prepare the polymer nanocomposites. The heat release rate (HRR) and flammability of the EP composites were tested by microscale combustion calorimetry and UL-94 instruments. The mechanical properties of the EP composites also were tested by a tension testing system. The results indicate that the flame retardancy and mechanical properties of the EP composites were improved by FAP-HNT. The addition of FAP-HNT and OP gave rise to an evident reduction of HRR and a prolonged burning time for the EP. EP/FAP-HNT/OP (20) (where 20 is the loading weight percentage) passed the UL 94 V-0 rating. The analysis of the char revealed the synergy of the FAP-HNTs and OP in reducing the flammability of the polymers. We concluded that these polymers show potential for applications in wastewater treatment and N/P recycling.