This paper demonstrates the usefulness of near-infrared optical fiber analysis for sensing moisture and liquid hydrocarbons in soil. Through experiments we have carried out sensing probes which have been developed, comprising optical fibers that use the evanescent field of the guided energy. The movement of water through dry sand was simulated in the laboratory and the sensors were used in situ to measure the variation of soil moisture in real time. A similar experiment simulated the movement of an organic liquid (mineral oil) through water-saturated sand, and the sensors were used in situ to monitor the hydrocarbon movement. We found that a hydrophobic polymer-coated waveguide can amplify the hydrocarbon signal while minimizing that of water, making it possible to detect a dissolved hydrocarbon. Tests show that the second derivative transform of the absorption spectra could be used to distinguish classes of hydrocarbons. © 2008 ASCE.