Abstract We propose a novel electron acceleration mechanism, which we call stochastic shock drift acceleration (SSDA), that extends the standard shock drift acceleration for low-energy electrons at a quasi-perpendicular shock to include the effect of stochastic pitch-angle scattering. We demonstrate that the steady-state energy spectrum of electrons accelerated within the shock transition region becomes a power law in the limit of strong scattering. The spectral index is independent of the pitch-angle scattering coefficient. On the other hand, the maximum energy attainable through the mechanism scales linearly with the pitch-angle scattering coefficient. These results have been confirmed by Monte Carlo simulations that include finite pitch-angle anisotropy. We find that the theory can reasonably well explain in situ observations of quasi-perpendicular Earth’s bow shock. The theoretical scaling law suggests that the maximum energy increases in proportion to the square of the shock speed, indicating that the thermal electrons may be accelerated up to mildly relativistic energies by the SSDA at quasi-perpendicular supernova remnant shocks. Therefore, the mechanism provides a plausible solution to the long-standing electron injection problem.