We report the nearest-neighbor oxygen-oxygen radial distribution function (NN O-O RDF) of room temperature liquid water and polycrystalline ice Ih (-16.8 degrees C) obtained by x-ray Raman based extended x-ray absorption fine structure (EXAFS) spectroscopy. The spectra of the two systems were taken under identical experimental conditions using the same procedures to obtain the NN O-O RDFs. This protocol ensured a measurement of the relative distance distribution with very small systematic errors. The NN O-O RDF of water is found to be more asymmetric (tail extending to longer distances) with longer average distance (2.81 A for water and 2.76 A for ice) but a slightly shorter peak position (2.70 A for water and 2.71 A for ice). The refinement also showed a small but significant contribution from the linear O-H-O multiple scattering signal. The high sensitivity to short range distances of the EXAFS probe will set further restrictions to the range of possible models of liquid water.