In order to achieve formaldehyde-free flame retardant finishing on cotton fabrics, a novel phosphorus and nitrogen-containing flame retardant polyether diol(PNFR) was synthesized from dimethyl methylphosphonate(DMMP) and diethanolamine(DEA) by transesterification polymerization using dibutyltin dilaurate as the catalyst, and it is also used for finishing cotton fabric. The structure and application performance of PNFR and the modified cotton were investigated by Fourier infrared spectrometer, thermal analyzer, scanning electron microscope, limited oxygen index tester and vertical burning instrument. The experimental results show that when the molar ratio of DMMP and DEA is 1.0∶1.3, the dosage of catalyst is 0.5% of total mass of reactants, the reaction temperature is 150 ℃, reaction time is 5 h and the dosage of PNFR is 200 g/L, the afterflame time, afterglow time, damaged length and limiting oxygen index(LOI) of the treated cotton fabric are 0 s, 12.1 cm and 28.4% respectively, reaching class B1 of national standard of flame retardant fabrics. Even after 10 washing cycles, class B2 of the treated cotton fabric is achieved while its LOI drops to 25.9%.