Humans are less likely to learn from individuals belonging to a different group (outgroup) than from individuals of their own group (ingroup), yet the source of this societally relevant deficit has remained unclear. Here we used neuroimaging and computational modeling to investigate how people learn from observing the actions and outcomes of ingroup and outgroup demonstrators. Politically left-wing male and female participants performed worse when observing computer-simulated actions they believed were from a right-wing outgroup member compared with those from a left-wing ingroup member. A control experiment in which participants observed choices from a nonhuman agent confirmed that this performance difference reflected an outgroup deficit, rather than an ingroup gain. Accounting for the outgroup deficit, a computational model showed that participants relied less on information from outgroup actions compared with ingroup actions, while learning from outgroup outcomes was not impaired. At the neural level, the differences in observational ingroup versus outgroup learning were reflected in lateral prefrontal activity. The stronger the activity in this region, the more strongly participants weighed ingroup compared with outgroup learning signals (action prediction errors), which formally captured deficits in outgroup learning. Together, our work provides a computational and neural account of why people learn less from observing outgroups.