Conventionally, interval velocities are derived from picked stacking velocities. The velocity-analysis algorithm proposed in this paper is also based on stacking velocities; however, it eliminates the conventional picking stage by always considering stacking velocities from the point of view of an interval-velocity model. This view leads to a model-based, automatic velocityanalysis algorithm.The algorithm seeks to find an interval-velocity model such that the stacking velocities calculated from that model give the most powerful stack. An additional penalty is incurred for models that differ in smoothness from an initial interval-velocity model. The search for the best model is conducted by means of a conjugategradient method.The connection between the interval-velocity model and the stacking velocities plays an important role in the algorithm proposed in this paper. In the simplest case, stacking velocity is assumed to be equal to rms velocity. For the more general case, a linear theory is developed, connecting interval velocity and stacking velocity through the intermediary of traveltime. When applied to a field data set, the method produces an interval-velocity model that explains the lateral variation in both stacking velocity and traveltime.