Despite advances in understanding the brain structures involved in the expression of stereotypes and prejudice, little is known about the brain structures involved in their acquisition. Here, we combined fMRI, a task involving learning the valence of different social groups, and modeling of the learning process involved in the development of biases in thinking about social groups that support prejudice. Participants read descriptions of valenced behaviors performed by members of novel social groups, with majority groups being more frequently encountered during learning than minority groups. A model-based fMRI analysis revealed that the anterior temporal lobe tracked the trial-by-trial changes in the valence associated with each group encountered in the task. Descriptions of behavior by group members that deviated from the group average (i.e., prediction errors) were associated with activity in the left lateral PFC, dorsomedial PFC, and lateral anterior temporal cortex. Minority social groups were associated with slower acquisition rates and more activity in the ventral striatum and ACC/dorsomedial PFC compared with majority groups. These findings provide new insights into the brain regions that (a) support the acquisition of prejudice and (b) detect situations in which an individual's behavior deviates from the prejudicial attitude held toward their group.