To evaluate vibronic spectra beyond the Condon approximation, we extend the on-the-fly ab initio thawed Gaussian approximation by considering the Herzberg–Teller contribution due to the dependence of the electronic transition dipole moment on nuclear coordinates. The extended thawed Gaussian approximation is tested on electronic absorption spectra of the phenyl radical and benzene; calculated spectra reproduce experimental data and are much more accurate than standard global harmonic approaches, confirming the significance of anharmonicity. Moreover, the extended method provides a tool to quantify the Herzberg–Teller contribution; we show that in the phenyl radical, anharmonicity outweighs the Herzberg–Teller contribution, whereas in benzene, the Herzberg–Teller contribution is essential because the transition is electronically forbidden and the Condon approximation yields a zero spectrum. Surprisingly, both adiabatic harmonic spectra outperform those of the vertical harmonic model, which describes the Franck–Condon region better. Finally, we provide a simple recipe for orientationally averaging spectra, valid beyond the Condon approximation, and a relation among the transition dipole, its gradient, and nonadiabatic coupling vectors.