Rapid prediction of ground motions of major earthquakes can assist emergency response and postseismic damage assessment. Numerical simulations can perform such prediction. However, they need a large number of calculations based on real data and depend on large‐scale computation resources, limiting practice of real‐time prediction. To solve this problem, this article proposes a new prediction method based on a 3D transfer function, which is obtained by solving the site seismic response to three impulse function excitations that can be calculated by different pre‐event 3D physics‐based numerical simulations. This approach only needs one seismic record in the study area and can quickly (near‐real time) predict ground motions in the whole study area. We verify the proposed approach with an 5.7 aftershock of the 2008 7.9 Wenchuan earthquake in the Wudu basin, Sichuan Province, China. The results show that this method is feasible and has sufficient accuracy in nearly real‐time prediction of seismic ground motions.