Paying attention to a stimulus selectively increases the ability to process it. For example, when subjects attend to a specific region of a visual scene, their sensitivity to changes at that location increases. A large number of studies describe the behavioural consequences and neurophysiological correlates of attending to spatial locations. There has, in contrast, been little study of the allocation of attention over time. Because subjects can anticipate predictable events with great temporal precision, it seems probable that they might dynamically shift their attention when performing a familiar perceptual task whose constraints changed over time. We trained monkeys to respond to a stimulus change where the probability of occurrence changed over time. Recording from area V4 of the visual cortex in these animals, we found that the modulation of neuronal responses changed according to the probability of the change occurring at that instant. Thus, we show that the attentional modulation of sensory neurons reflects a subject's anticipation of the timing of behaviourally relevant events.