An individual can learn about someone else’s traits by accumulating experiences from the specific relationship and by incorporating group identity information. Here we examine how group identity affects learning about others and the social learning mechanisms underlying the persistence of intergroup bias. Participants played a game with four other bot-players that entailed collecting stars and could sacrifice a move to zap another player, who would then lose three turns. The bot-players' avatars were either the same or a different color than the participant's avatar. Over six experimental conditions, participants were exposed to different behavioral patterns of bot-players—either zappers or zap-avoiders. We found that participants adjusted their zapping behavior according to the bot-player's behavior and were more likely to zap zappers than avoiders. Participants were also more likely to zap outgroup players and less likely to zap ingroup players, regardless of the player’s behavior, indicating a persistent intergroup bias. Using a computational learning model, we identified the contribution of three learning mechanisms to this tendency. Prior beliefs about players' zapping behavior were higher for outgroup than for ingroup players. Learning rates were very low for outgroup players, making it very difficult to overcome prior beliefs, whereas learning rates for ingroup players were high. Finally, participants attributed the negative behavior of one outgroup player to all other outgroup players, making beliefs about outgroup players more homogeneous. Our results show how group identity shapes and confounds social learning and highlight how intergroup bias can persist despite interaction and experience.