Gold nanoparticles are obtained by reduction of a Au(iii) precursor within an agarose hydrogel where they form percolating networks upon partial dehydration and shrinkage of the gel.