We have examined the effect of the different components in the spontaneous formation of surfactant-templated mesostructured silicate films grown at the air/solution interface. The rate of film formation shows differing dependencies on the concentrations of the silica precursor, tetramethoxysilane, the surfactant template, cetyltrimethylammonium bromide (CTAB), water and the solution pH. Further, we relate the nature of the film formation to the properties of the dried film using small angle scattering methods. From this data a general formation mechanism for the interaction between silica and surfactant micelles in this system is proposed. The polymerising silica can be considered as a cationic polyelectrolyte which interacts with the positively charged CTAB micelles through the bromine anion of the surfactant and via adsorption of the micelles as the polymer becomes more hydrophobic. This polyelectrolyte-surfactant system undergoes a liquid-liquid phase separation (coacervation) at a critical point dependant on the charge and molecular weight of the polymer and the charge on the surfactant micelle. (C) 2003 Elsevier Inc. All rights reserved.