Electroencephalographic (EEG) source imaging depends upon sophisticated signal processing algorithms to deal with the problems of data cleaning, source separation, and localization. Typically, these problems are sequentially addressed by independent heuristics, limiting the use of EEG images on a variety of applications. Here, we propose a unifying empirical Bayes framework in which these dissimilar problems can be solved using a single algorithm. We use spatial sparsity constraints to adaptively segregate brain sources into maximally independent components with known anatomical support, while minimally overlapping artifactual activity. The framework yields a recursive inverse spatiotemporal filter that can be used for offline and online applications. We call this filter Recursive Sparse Bayesian Learning (RSBL). Of theoretical relevance, we demonstrate the connections between Infomax Independent Component Analysis and RSBL. We use simulations to show that RSBL can separate and localize cortical and artifact components that overlap in space and time from noisy data. On real data, we use RSBL to analyze single-trial error-related potentials, finding sources in the cingulate gyrus. We further benchmark our algorithm on two unrelated EEG studies showing that: 1) it outperforms Infomax for source separation on short time-scales and 2), unlike the popular Artifact Subspace Removal algorithm, it can reduce artifacts without significantly distorting clean epochs. Finally, we analyze mobile brain/body imaging data to characterize the brain dynamics supporting heading computation during full-body rotations, replicating the main findings of previous experimental literature.