Blazars are the most extreme active galactic nuclei. They possess oppositely directed plasma jets emanating at near light speeds from accreting supermassive black holes. According to theoretical models, such jets are propelled by magnetic fields twisted by differential rotation of the black hole's accretion disk or inertial-frame-dragging ergosphere. The flow velocity increases outward along the jet in an acceleration and collimation zone containing a coiled magnetic field. Detailed observations of outbursts of electromagnetic radiation, for which blazars are famous, can potentially probe the zone. It has hitherto not been possible to either specify the location of the outbursts or verify the general picture of jet formation. Here we report sequences of high-resolution radio images and optical polarization measurements of the blazar BL Lacertae. The data reveal a bright feature in the jet that causes a double flare of radiation from optical frequencies to TeV γ-ray energies, as well as a delayed outburst at radio wavelengths. We conclude that the event starts in a region with a helical magnetic field that we identify with the acceleration and collimation zone predicted by the theories. The feature brightens again when it crosses a standing shock wave corresponding to the bright `core' seen on the images.