Current models of flexible cognitive control emphasize the role of the prefrontal cortex. This region has been shown to control attention by biasing information processing in favor of task-relevant representations. However, the prefrontal cortex does not act in isolation. We used functional magnetic resonance imaging combined with nonlinear dynamic causal modeling to demonstrate that the basal ganglia play a role in modulating the top-down influence of the prefrontal cortex on visual processing in humans. Specifically, our results reveal that connectivity between the prefrontal cortex and stimulus-specific visual association areas depends on activity in the ventral striatopallidum, elicited by salient events leading to shifts in attention. These data integrate disparate literatures on top-down control by the prefrontal cortex and selective gating by the basal ganglia and highlight the importance of the basal ganglia for high-level cognitive control.