Silver-based nanocomposites are known to act as biocides against a series of microorganisms and are largely studied as an alternative to substitute conventional antibiotics that show decreasing efficacy. In this work, an eco-friendly method to synthesize silver nanoparticles assembled on the surface of hexaniobate crystals is reported. By means of ion exchange, K+ ions of layered potassium hexaniobate were partially substituted by Ag+ ions and the resulting material was exposed to UV light. The irradiation allowed the reduction of silver ions with consequent formation of silver nanoparticles located only on the hexaniobate surface, whereas Ag+ ions located in the interlayer space remained in the ionic form. Increasing UV-light exposure times allowed controlling of the silver nanoparticle size. The antibacterial effects of the pristine potassium hexaniobate and of silver-containing hexaniobate samples were tested against Escherichia coli (E. coli). The antibacterial efficacy was determined to be related to the presence of silver in hexaniobate. An increasing activity against E. coli was observed with the decrease in silver nanoparticles size, suggesting that silver nanoparticles of distinct sizes interact differently with bacterial cell walls.