Abstract For eathquakes occurring on fault planes whose horizontal dimensions are very much greater than the vertical dimensions, the assumption of infinite fault length allows the dislocation stress fields to be expressed by simple analytical equations. This facilitates an important generalization of the dislocation theory of earthquakes, in which the fault displacement is graded to zero at the edges of the fault planes, thus avoiding singularities in the stress fields, which are still represented by straightforward analytical expressions. This development is necessary for realistic calculations of seismomagnetic anomalies, due to the piezomagnetic effect in rocks above the Curie point isotherm. The best fit to geodetic observations on the San Francisco earthquake of 1906 is given by a model in which a horizontal slip of 5m at the surface grades either linearly or sinusoidally to zero at (5 ± 1.5) km depth. Vertical displacements of the Alaskan earthquake of 1964 are represented by a compound dislocation having a vertical slip with a maximum value of 40m at 65m depth, graded to zero at 5km and 125km. Maximum total magnetic field anomalies for these models are respectively 2 gammas and 1 gamma per 10−3 e.m.u. of rock magnetization.