Electron heating at Earth's quasiperpendicular bow shock has been surmised to be due to the combined effects of a quasistatic electric potential and scattering through wave-particle interaction. Here we report the observation of electron distribution functions indicating a new electron heating process occurring at the leading edge of the shock front. Incident solar wind electrons are accelerated parallel to the magnetic field toward downstream, reaching an electron-ion relative drift speed exceeding the electron thermal speed. The bulk acceleration is associated with an electric field pulse embedded in a whistler-mode wave. The high electron-ion relative drift is relaxed primarily through a nonlinear current-driven instability. The relaxed distributions contain a beam traveling toward the shock as a remnant of the accelerated electrons. Similar distribution functions prevail throughout the shock transition layer, suggesting that the observed acceleration and thermalization is essential to the cross-shock electron heating.