During compression of a water dimer calculated with high-precision first-principles methods, the trends of H-bond and O-H bond lengths show quantum effect of the electronic structure. We found that the H-bond length keeps decreasing, while the O-H bond length increases up to the stable point and decreases beyond it when the water dimer is further compressed. The remarkable properties are different from those observed in most previous researches which can be understood and extrapolated through classical simulation. The observations can be explained by the decrease in orbital overlap and change in the exchange repulsion interaction between water monomers. The dominant interaction between water monomers changes from electrostatic interaction to exchange repulsion at the turning point of the O-H bond length when the O...O distance is decreased. These findings highlight the quantum effect on the hydrogen bond in extreme conditions and play an important role in the recognition of the hydrogen bond structure and mechanism.