The neural mechanisms of deviancy and target detection were investigated by combining high density event-related potential (ERP) recordings with functional magnetic resonance imaging (fMRI). ERP and fMRI responses were recorded using the same paradigm and the same subjects. Unattended deviants elicited a mismatch negativity (MMN) in the ERP. In the fMRI data, activations of transverse/superior temporal gyri bilateral were found. Attended deviants generated an MMN followed by an N2/P3b complex. For this condition, fMRI activations in both superior temporal gyri and the neostriatum were found. These activations were taken as neuroanatomical constraints for the localization of equivalent current dipoles. Inverse solutions for dipole orientation provide evidence for significant activation close to Heschl's gyri during deviancy processing in the 110–160-ms time interval (MMN), whereas target detection could be modeled by two dipoles in the superior temporal gyrus between 320 and 380 ms.