Determining the origin of water and the timing of its accretion within the inner solar system is important for understanding the dynamics of planet formation. The timing of water accretion to the inner solar system also has implications for how and when life emerged on Earth. We report in situ measurements of the hydrogen isotopic composition of the mineral apatite in eucrite meteorites, whose parent body is the main-belt asteroid 4 Vesta. These measurements sample one of the oldest hydrogen reservoirs in the solar system and show that Vesta contains the same hydrogen isotopic composition as that of carbonaceous chondrites. Taking into account the old ages of eucrite meteorites and their similarity to Earth’s isotopic ratios of hydrogen, carbon, and nitrogen, we demonstrate that these volatiles could have been added early to Earth, rather than gained during a late accretion event.