It has been recently established that self-healing slip pulses under uniform background/ambient stress (prestress) z b are intrinsically unstable frictional rupture modes, i.e., they either slowly expand or decay with time t . Furthermore, their spatiotemporal dynamics have been shown to follow a reduced-dimensionality description corresponding to a special one-dimensional curve L(c), parameterized by z b , in a plane defined by the pulse propagation velocity c(t) and size L(t). Yet, uniform prestress is rather the exception than the rule in natural faults. Here, we study the effects of a spatially-varying prestress zb(x) (in the fault direction x ) on 2D slip pulses, initially generated under a uniform zb along a rate-and-state friction fault. We consider both periodic and constant-gradient prestress distributions zb(x) around the reference uniform z b . For a periodic zb(x), pulses either sustain and form quasi-limit cycles in the L-c plane or decay predominantly monotonically along the L(c) curve depending on the instability index of the initial pulse and the properties of the periodic zb(x). For a constant-gradient zb(x), expanding and decaying pulses closely follow the L(c) curve, with small systematic shifts determined by the sign and magnitude of the gradient. We also find that a spatially-varying zb(x) can revert the expanding/decaying nature of the initial reference pulse. Finally, we show that a constant-gradient zb(x), of sufficient magnitude and specific sign, can lead to the nucleation of a back-propagating rupture at the healing tail of the initial pulse, generating a bilateral crack-like rupture. This pulse-to-crack transition, along with the above- described effects, demonstrates that rather rich rupture dynamics can emerge from a simple, spatially-varying prestress. Furthermore, our results show that as long as pulses exist, their spatiotemporal dynamics are related to the special L(c) curve, providing an effective, reduced-dimensionality description of unsteady slip pulses under spatially-varying prestress.