The high-pressure behaviour of H2O is of fundamental importance in both condensed matter and planetary physics1,2. The hydrogen bonding in this system gives rise to a variety of phases at low pressures and temperatures (that is, <2 GPa and <300 K), including the recently discovered high-density amorphous phases3. Structural and equation-of-state4,5 and spectroscopic6-8 studies have been carried out in the 30-50 GPa range on the dense ices (ice VII and VIII), but no data are available on the properties of solid H2O in the megabar pressure range (>100 GPa) where a variety of stable phases, including the metallic form, have been proposed9. Information on the properties of H2O at these pressures has been limited to the results of shock-wave experiments, which probe the fluid phase at high pressures and temperatures10, and to theoretical statistical electron calculations11-15. In this study we have compressed ice in a diamond-anvil cell to 128 GPa and measured the molar volume as a function of pressure by synchrotron X-ray diffraction techniques. The diffraction data are consistent with the body-centred cubic (b.c.c.) oxygen sublattice of ice VII persisting to the highest pressures of our measurements. The measured equation of state indicates that ice is less compressible at very high pressures than is suggested by recent experiments in the 30-50 GPa range, but more compressible than statistical electron and recent pair-potential models predict.