The search for active semiconductor photocatalysts that directly split water under visible-light irradiation remains one of the most challenging tasks for solar-energy utilization. Over the past 30 years, the search for such materials has focused mainly on metal-ion substitution as in In(1-x)Ni(x)TaO(4) and (V-,Fe- or Mn-)TiO(2) (refs 7,8), non-metal-ion substitution as in TiO(2-x)N(x) and Sm(2)Ti(2)O(5)S(2) (refs 9,10) or solid-solution fabrication as in (Ga(1-x)Zn(x))(N(1-x)O(x)) and ZnS-CuInS(2)-AgInS(2) (refs 11,12). Here we report a new use of Ag(3)PO(4) semiconductor, which can harness visible light to oxidize water as well as decompose organic contaminants in aqueous solution. This suggests its potential as a photofunctional material for both water splitting and waste-water cleaning. More generally, it suggests the incorporation of p block elements and alkali or alkaline earth ions into a simple oxide of narrow bandgap as a strategy to design new photoelectrodes or photocatalysts.