Hybrid phosphorus-doped silica films have been prepared through sol-gel processes to enhance the thermal and fire stability of cotton. To this aim, 3-aminopropyltriethoxysilane and N,N,N',N',NaEuro(3),NaEuro(3)-hexakis-methoxymethyl-[1,3,5]triazine-2,4,6-triamine have been reacted with diethylphosphatoethyltriethoxysilane. FT-IR spectroscopy was exploited for assessing the formation of the silica skeleton on the cotton surface and for evaluating the interactions between the cellulosic fibres and the doped film. The effect of the concurrent presence of Si, P and N on cotton has been investigated by thermogravimetric analyses and the flammability behaviour has been assessed by vertical flammability tests, as well. The sol-gel treatments in the presence of phosphorus and nitrogen turned out to play a protective role on the degradation of the cotton fibres, hindering the formation of volatile species that fuel the further degradation and favouring the formation of a carbonaceous structure.