In the primordial Solar System the most plausible sources of the water accreted by the Earth were in the outer asteroid belt, in the giant planet regions and in the Kuiper belt. We investigate the implications on the origin of Earth's water of dynamical models of primordial evolution of solar system bodies and check them with respect to chemical constraints. We find that it is plausible that the Earth accreted water all along its formation, from the early phases when the solar nebula was still present to the late stages of gas-free sweepup of scattered planetesimals. Asteroids and the comets from the Jupiter-Saturn region were the first water deliverers, when the Earth was less than half its present mass. The bulk of the water presently on Earth was carried by a few planetary embryos, originally formed in the outer asteroid belt and accreted by the Earth at the final stage of its formation. Finally, a late veneer, accounting for at most 10% of the present water mass, occurred due to comets from the Uranus-Neptune region and from the Kuiper belt. The net result of accretion from these several reservoirs is that the water on Earth had essentially the D/H ratio typical of the water condensed in the outer asteroid belt. This is in agreement with the observation that the D/H ratio in the oceans is very close to the mean value of the D/H ratio of the water inclusions in carbonaceous chondrites.