Setting perceptual expectations can be based on different sources of information that determine which functional networks will be involved in implementing preparatory top–down influences and dealing with situations in which expectations are violated. The goal of the present study was to investigate and directly compare brain activations triggered by violating expectations within two different task contexts. In the serial prediction task, participants monitored ordered perceptual sequences for predefined sequential deviants. In contrast, the target detection task entailed a presentation of stimuli which had to be monitored for predefined nonsequential deviants. Detection of sequential deviants triggered an increase of activity in premotor and cerebellar components of the “standard” sequencing network and activations in additional frontal areas initially not involved in sequencing. This pattern of activity reflects the detection of a mismatch between the expected and presented stimuli, updating of the underlying sequence representation (i.e., forward model), and elaboration of the violation. In contrast, target detection elicited activations in posterior temporal and parietal areas, reflecting an increase in perceptual processing evoked by the nonsequential deviant. The obtained results suggest that distinct functional networks involved in detecting deviants in different contexts reflect the origin and the nature of expectations being violated.