In order to react adequately to potentially relevant information outside the focus of attention, our brain preattentively scans the acoustic environment for irregularities. Two different mechanisms are currently discussed: (i) a sensory one based on differential states of refractoriness of neurons sensitive to the features of a regular event and of neurons sensitive to features of an irregular event; (ii) a cognitive one based on a comparison of short-lived memory representations encoding current stimulation and the invariance inherent in recent recurrent stimulation. Here, we identified regions that mediate either of the two mechanisms by combining functional magnetic resonance imaging with an experimental protocol controlling for refractoriness. The sensory mechanism was associated with activity in the primary auditory cortex, whereas the cognitive one revealed activity in nonprimary auditory areas in the anterior part of Heschl's Gyrus. Moreover, it turned out that in the traditional oddball paradigm both mechanisms contribute to irregularity detection.