A facile method was developed for in situ construction of a porous network-like Ag film on a glassy carbon electrode by a galvanic replacement reaction, where a layer of Cu nanoparticles previously electrodeposited as a sacrificial template. Thus-formed Ag film displays excellent electrocatalytic activity, good stability, and fast response (within 2 s) toward nitrate reduction.