Blazars are active galactic nuclei (AGN) with relativistic jets whose non-thermal radiation is extremely variable on various timescales1–3. This variability seems mostly random, although some quasi-periodic oscillations (QPOs), implying systematic processes, have been reported in blazars and other AGN. QPOs with timescales of days or hours are especially rare4 in AGN and their nature is highly debated, explained by emitting plasma moving helically inside the jet5, plasma instabilities6,7 or orbital motion in an accretion disc7,8. Here we report results of intense optical and γ-ray flux monitoring of BL Lacertae (BL Lac) during a dramatic outburst in 2020 (ref. 9). BL Lac, the prototype of a subclass of blazars10, is powered by a 1.7 × 108 MSun (ref. 11) black hole in an elliptical galaxy (distance = 313 megaparsecs (ref. 12)). Our observations show QPOs of optical flux and linear polarization, and γ-ray flux, with cycles as short as approximately 13 h during the highest state of the outburst. The QPO properties match the expectations of current-driven kink instabilities6 near a recollimation shock about 5 parsecs (pc) from the black hole in the wake of an apparent superluminal feature moving down the jet. Such a kink is apparent in a microwave Very Long Baseline Array (VLBA) image.