Mesoporous aluminophosphate thin films with 3D cubic (Im3x305;m) pore arrangement were synthesized for the first time. Thin films were templated with block copolymer nonionic templates Pluronic F127 and F108 and deposited on a glass substrate by dip-coating. In situ SAXS investigations show the formation of a highly ordered mesostructure upon the dip-coating process, which remains stable up to at least 670 K. A cubic mesostructure was observed also by TEM. Template removal process was monitored by TG and FT-IR. A transition from an amorphous aluminophosphate gel to a well-defined aluminophosphate framework was observed by MAS NMR.