ABSTRACT Habituation shows organisms’ ability to ignore irrelevant repetitive stimuli, allowing attentional resources to be allocated to the relevant information. Here we investigated the role of contextual information in generating expectations that control habituation to visual onset distractors, expectations that arise from associative learning. Experiment 1 showed that the habituated capture response is restored if the onset distractor is momentarily omitted in the same context of habituation, but not if such omission is experienced in another context. Experiment 2 showed that the pre-exposure to a context in which a distractor is later encountered reduced participants’ capacity to ignore it, thus attesting a latent learning phenomenon affecting habituation of capture. Finally, Experiment 3 showed that ignoring a new distractor is easier in a context in which habituation has already taken place for a different distractor. Taken together, these results attest the context-specific nature of habituation and suggest that learning to ignore salient visual stimuli is based on expectations encoded through associative learning.