Rock physics studies have shown that velocity dispersion is often associated with hydrocarbon deposit, which results in P-wave reflection coefficients varying with frequency. This effect is often neglected in the conventional amplitude versus angle or offset inversion, and thus error is introduced. Here we propose a method for inverting for dispersive velocity from the frequency-dependent P-wave reflection coefficients; the method is called amplitude variation with angle and frequency AVAF inversion. We employ forward modeling based on propagator matrices that include frequency-dependent elastic coefficients and a variant of the simulated annealing method called the heat-bath algorithm for inversion of layer parameters. In our application, the thickness of the dispersive layer is inverted for simultaneously. Synthetic and field data examples demonstrate the ability and usefulness of this method for detecting hydrocarbon bearing formations.