Dynamic-crack earthquake simulations generally assume that the crustal material surrounding faults is laterally homogeneous. Tomographic and near-fault seismic studies indicate that the crust near faults is instead comprised of rocks of varying material velocities. We have tested the effects of adding material-velocity variation to simulations of spontaneously propagating earthquakes. We used two-dimensional plane strain conditions coupled with a slip-weakening fracture criterion and examined earthquakes on faults that bisect finite-width low-velocity zones embedded in country rock and earthquakes on faults that bound two different-velocity materials. When a fault bisects a low-velocity zone, the normal stress remains unchanged, but both the rupture velocity and slip-velocity pulse shape are perturbed. The presence of the low-velocity zone induces high-frequency oscillations in the slip function near the rupture front. When the fault is on the edge of the low-velocity zone, the oscillations are more pronounced, and repeated sticking and slipping can occur near the rupture front. For the slip-weakening (velocity-independent) friction model, however, the temporary sticking does not lead to permanent arrest of slip, and slip duration is still controlled by the overall rupture dimension. When an earthquake ruptures a fault juxtaposing a lower-velocity material against a higher-velocity material, the normal stress across the fault near the crack tip is perturbed. The sign of the normal stress perturbation depends on the direction of rupture, leading in some cases to a directional dependence of rupture velocity. When slip is accompanied by stress reduction, a positive feedback develops between the normal and shear stress changes, as previously noted by Andrews and Ben-Zion (1997), resulting in an apparently unavoidable grid-size dependence in computation of stress change near the rupture front. Numerical experiments indicate, however, that the rupture velocity is insensitive to this zone size dependence, which is highly localized immediately behind the crack tip. The factors controlling the rupture velocity in the simulations, including directional dependence, are further elucidated by a new analytical solution for rupture of an asperity on a frictionless interface.