Besides the fact that RTs in cognitive tasks are affected by the specific demands of a trial, the context in which this trial occurs codetermines the speed of the response. For instance, invalid spatial cues generally prolong RTs to targets in the location-cueing paradigm, whereas the magnitude of these RT costs additionally varies as a function of the preceding trial types so that RTs for invalid trials may be increased when preceded by valid rather than invalid trials. In the present fMRI study, we investigated trial sequence effects in a combined oddball and location-cueing paradigm. In particular, we tested whether RTs and neural activity to infrequent invalid or deviant targets varied as a function of the number of preceding valid standard trials. As expected, RTs in invalid and deviant trials were significantly slower when more valid standard trials had been presented beforehand. This behavioral effect was reflected in the neural activity of the right inferior/middle frontal gyrus where the amplitude of the hemodynamic response in invalid and deviant trials was positively related to the number of preceding valid standard trials. In contrast, decreased activity (i.e., a negative parametric modulation effect) was observed when more valid standard trials were successively presented. Further positive parametric effects for the number of preceding valid standard trials were observed in the left caudate nucleus and lingual gyrus. The data suggest that inferior frontal cortex extracts both event regularities and irregularities in event streams.