The anterior cingulate (AC) cortex seems to be similarly engaged by attentional and memory processes. We tested the hypothesis that this common activation is best explained by changes in the regions interacting (functionally connected) with AC. Subjects were tested on two variants of a 2-back working memory task: a standard version with strong attentional demands, and a cued version that more strongly promoted memory retrieval. AC activation, measured with functional MRI, was found in both tasks, although more sustained in the standard condition. The regions functionally connected to the AC, and the relation of these activity patterns to memory performance, were completely different across tasks. In the standard task, the pattern related to a speed-accuracy tradeoff, whereas the connectivity pattern unique to the cued task related only to better accuracy. By virtue of these changing patterns of functional connectivity, the contribution of AC to attention-and memory-driven performance was similarly changed.