Charged particles can be reflected and accelerated by strong (i.e., high Mach number) astrophysical collisionless shock waves, streaming away to form a foreshock region in communication with the shock. Foreshocks are primarily populated by suprathermal ions that can generate foreshock disturbances—large-scale (i.e., tens to thousands of thermal ion Larmor radii), transient (~5–10 per day) structures. They have recently been found to accelerate ions to energies of several keV. Although electrons in Saturn's high Mach number (M > 40) bow shock can be accelerated to relativistic energies (nearly 1000 keV), it has hitherto been thought impossible to accelerate electrons beyond a few tens of keV at Earth's low Mach number (1 ≤ M < 20) bow shock. Here we report observations of electrons energized by foreshock disturbances to energies up to at least ~300 keV. Although such energetic electrons have been previously observed, their presence has been attributed to escaping magnetospheric particles or solar events. These relativistic electrons are not associated with any solar or magnetospheric activity. Further, due to their relatively small Larmor radii (compared to magnetic gradient scale lengths) and large thermal speeds (compared to shock speeds), no known shock acceleration mechanism can energize thermal electrons up to relativistic energies. The discovery of relativistic electrons associated with foreshock structures commonly generated in astrophysical shocks could provide a new paradigm for electron injections and acceleration in collisionless plasmas.