TiO2 photocatalysts have been found to kill cancer cells, bacteria and viruses under mild UV illumination, which offers numerous potential applications. On the other hand, Ag has long been proved as a good antibacterial material as well. The advantage of Ag-TiO2 nanocomposite is to expand the nanomaterial's antibacterial function to a broader range of working conditions. In this study neat TiO2 and Ag-TiO2 composite nanofilms were successfully prepared on silicon wafer via the sol-gel method by the spin-coating technique. The as-prepared composite Ag-TiO2 and TiO2 films with different silver content were characterized by scanning electron microscopy (SEM), atomic force microscopy (AFM), x-ray diffraction (XRD) and x-ray photoelectron spectroscopy (XPS) to determine the topologies, microstructures and chemical compositions, respectively. It was found that the silver nanoparticles were uniformly distributed and strongly attached to the mesoporous TiO2 matrix. The morphology of the composite film could be controlled by simply tuning the molar ratio of the silver nitrate aqueous solution. XPS results confirmed that the Ag was in the Ag(0) state. The antimicrobial effect of the synthesized nanofilms was carried out against gram-negative bacteria (Escherichia coli ATCC 29425) by using an 8 W UV lamp with a constant relative intensity of 0.6 mW cm(-2) and in the dark respectively. The synthesized Ag-TiO2 thin films showed enhanced bactericidal activities compared to the neat TiO2 nanofilm both in the dark and under UV illumination.