Social rejection often increases aggression, but the neural mechanisms underlying this effect remain unclear. This experiment tested whether neural activity in the dorsal anterior cingulate cortex (dACC) and anterior insula in response to social rejection predicted greater subsequent aggression. Additionally, it tested whether executive functioning moderated this relationship. Participants completed a behavioral measure of executive functioning, experienced social rejection while undergoing functional magnetic resonance imaging and then completed a task in which they could aggress against a person who rejected them using noise blasts . We found that dACC activation and executive functioning interacted to predict aggression. Specifically, participants with low executive functioning showed a positive association between dACC activation and aggression, whereas individuals with high executive functioning showed a negative association. Similar results were found for the left anterior insula. These findings suggest that social pain can increase or decrease aggression, depending on an individual’s regulatory capability.