We used an individual-differences approach to test whether general fluid intelligence (gF) is mediated by brain regions that support attentional (executive) control, including subregions of the prefrontal cortex. Forty-eight participants first completed a standard measure of gF (Raven's Advanced Progressive Matrices). They then performed verbal and nonverbal versions of a challenging working-memory task (three-back) while their brain activity was measured using functional magnetic resonance imaging (fMRI). Trials within the three-back task varied greatly in the demand for attentional control because of differences in trial-to-trial interference. On high-interference trials specifically, participants with higher gF were more accurate and had greater event-related neural activity in several brain regions. Multiple regression analyses indicated that lateral prefrontal and parietal regions may mediate the relation between ability (gF) and performance (accuracy despite interference), providing constraints on the neural mechanisms that support gF.