The development of highly durable flame-retardant (FR) silk textiles has significant practical implications. This study presents an innovative in situ deposition technique for imparting durable functionality to silk textiles. Insoluble FR compounds were formed within silk fibers by reacting tetrakis(hydroxymethyl) phosphine sulfate and dicyandiamide with a phosphate ester compound. The chemical structure of the insoluble FR compounds, surface morphology, physical properties, combustion behavior, washing resistance and flame retardancy mechanism of modified silk fabrics were explored. The modified silk fabrics exhibited a decrease in damaged length to 7.0 cm and an increase in limiting oxygen index (LOI) value to 31.4 % from 25.0 % of pristine silk. Furthermore, a highly durable FR performance was maintained after 50 washing cycles, which was attributed to in situ deposition of phosphorus/nitrogen compounds. Additionally, the modified silk displayed significant heat suppression by 68.2 %. The improved fire safety of silk fabrics was attributed to a combined condensed phase action, which promoted charring of silk, and a gas phase action, which formed phosphorus-containing free radicals and noncombustible gases. Notably, the FR modification had less influence on whiteness, tensile strength and air permeability of silk fabrics. This research presents a novel strategy for the development of durable FR silk fabrics.