The spectral variability of the blazar CTA 102 during a recent extreme outburst could be explained by a twisted, inhomogeneous jet containing regions of different orientations that vary in time.
Blazars are active galactic nuclei, which are powerful sources of radiation whose central engine is located in the core of the host galaxy. Blazar emission is dominated by non-thermal radiation from a jet that moves relativistically towards us, and therefore undergoes Doppler beaming1. This beaming causes flux enhancement and contraction of the variability timescales, so that most blazars appear as luminous sources characterized by noticeable and fast changes in brightness at all frequencies. The mechanism that produces this unpredictable variability is under debate, but proposed mechanisms include injection, acceleration and cooling of particles2, with possible intervention of shock waves3,4 or turbulence5. Changes in the viewing angle of the observed emitting knots or jet regions have also been suggested as an explanation of flaring events6,7,8,9,10 and can also explain specific properties of blazar emission, such as intra-day variability11, quasi-periodicity12,13 and the delay of radio flux variations relative to optical changes14. Such a geometric interpretation, however, is not universally accepted because alternative explanations based on changes in physical conditions—such as the size and speed of the emitting zone, the magnetic field, the number of emitting particles and their energy distribution—can explain snapshots of the spectral behaviour of blazars in many cases15,16. Here we report the results of optical-to-radio-wavelength monitoring of the blazar CTA 102 and show that the observed long-term trends of the flux and spectral variability are best explained by an inhomogeneous, curved jet that undergoes changes in orientation over time. We propose that magnetohydrodynamic instabilities17 or rotation of the twisted jet6 cause different jet regions to change their orientation and hence their relative Doppler factors. In particular, the extreme optical outburst of 2016-2017 (brightness increase of six magnitudes) occurred when the corresponding emitting region had a small viewing angle. The agreement between observations and theoretical predictions can be seen as further validation of the relativistic beaming theory.