The fronto-parietal attention networks have been extensively studied with functional magnetic resonance imaging (fMRI), but spatiotemporal dynamics of these networks are not well understood. We measured event-related potentials (ERPs) with electroencephalography (EEG) and collected fMRI data from identical experiments where participants performed visual and auditory discrimination tasks separately or simultaneously and with or without distractors. To overcome the low temporal resolution of fMRI, we used a novel ERP-based application of multivariate representational similarity analysis (RSA) to parse time-averaged fMRI pattern activity into distinct spatial maps that each corresponded, in representational structure, to a short temporal ERP segment. Discriminant analysis of ERP-fMRI correlations revealed 8 cortical networks - 2 sensory, 3 attention, and 3 other - segregated by 4 orthogonal, temporally multifaceted and spatially distributed functions. We interpret these functions as 4 spatiotemporal components of attention: modality-dependent and stimulus-driven orienting, top-down control, mode transition, and response preparation, selection and execution.