Transient variations in pupil size (PS) under constant luminance are coupled to rapid changes in arousal state,1, 2, 3 which have been interpreted as vigilance,⁴ salience,⁵ or a surprise signal.6, 7, 8 Neural control of such fluctuations presumably involves multiple brain regions⁵,9, 10, 11 and neuromodulatory systems,³,¹²,¹³ but it is often associated with phasic activity of the noradrenergic system.⁹,¹²,¹⁴,¹⁵ Serotonin (5-HT), a neuromodulator also implicated in aspects of arousal¹⁶ such as sleep-wake transitions,¹⁷ motivational state regulation,¹⁸ and signaling of unexpected events,¹⁹ seems to affect PS,20, 21, 22, 23, 24 but these effects have not been investigated in detail. Here we show that phasic 5-HT neuron stimulation causes transient PS changes. We used optogenetic activation of 5-HT neurons in the dorsal raphe nucleus (DRN) of head-fixed mice performing a foraging task. 5-HT-driven modulations of PS were maintained throughout the photostimulation period and sustained for a few seconds after the end of stimulation. We found no evidence that the increase in PS with activation of 5-HT neurons resulted from interactions of photostimulation with behavioral variables, such as locomotion or licking. Furthermore, we observed that the effect of 5-HT on PS depended on the level of environmental uncertainty, consistent with the idea that 5-HT could report a surprise signal.¹⁹ These results advance our understanding of the neuromodulatory control of PS, revealing a tight relationship between phasic activation of 5-HT neurons and changes in PS.