Near‐field ground motion is the major blind spot of seismic hazard studies, mainly because of the challenges in accounting for source effects. Initial stress heterogeneity is an important component of physics‐based approaches to ground‐motion prediction that represents source effects through dynamic earthquake rupture modeling. We hypothesize that stress heterogeneity on a fault primarily originates from past background seismicity. We develop a new method to generate stochastic stress distributions as a superposition of residual stresses left by the previous ruptures that are consistent with regional distributions of earthquake size and hypocentral depth. We validate our method on 7 earthquake models suitable for California by obtaining a satisfactory agreement with empirical earthquake scaling laws and ground‐motion prediction equations. To avoid the excessive seismic radiation produced by dynamic models with abrupt arrest at preset rupture borders, we achieve spontaneous rupture arrest by incorporating a growth of fracture energy as a function of hypocentral distance. Our analyses of rupture and ground motion reveal particular signatures of the initial stress heterogeneity: rupture can locally propagate at supershear speed near the highly stressed areas; the position of high‐stress and low‐stress areas due to initial stress heterogeneity determines how the peak ground‐motion amplitudes and polarization spatially vary along the fault, as low‐stress areas slow down the rupture and decrease stress drop. We also find that the medium stratification in the fault zone amplifies fault slip and consequent ground motion, which requires understanding the interaction between site effects and rupture dynamics. Our approach advances our understanding of the relations between dynamic features of earthquake ruptures and the statistics of regional seismicity, and our capability to integrate information about regional seismicity into near‐field ground‐motion prediction.