We have investigated the role of localized {it d} bands in the dynamical response of Au, on the basis of {it ab initio} pseudopotential calculations. The density-response function has been evaluated in the random-phase approximation. For small momenta, we have found a double peak structure in the energy-loss function, which results from the presence of {it d} electrons. These results are in good agreement with the experimentally determined optical response of gold. We also analyze the dependence of the dynamical structure factor on the wave vector {bf q}.