People often favor members of their own group, while discriminating against members of other groups. Such in-group favoritism has been shown to play an important role in human cooperation. However, in the face of changing conflicts and shifting alliances, it is essential for group identities to be flexible. Using the dictator game from behavioral economics, we demonstrate the remodeling of group identities among supporters of Democratic presidential candidates Barack Obama and Hillary Clinton. After Clinton's concession in June 2008, Democrats were more generous toward supporters of their own preferred candidate than to supporters of the other Democratic candidate. The bias observed in June persisted into August, and disappeared only in early September after the Democratic National Convention. We also observe a strong gender effect, with bias both appearing and subsiding among men only. This experimental study illustrates a dynamic change in bias, tracking the realignment of real world conflict lines and public efforts to reconstitute group identity. The change in salient group identity we describe here likely contributed to the victory of Barack Obama in the 2008 presidential election.dictator game ͉ economic games ͉ evolution of cooperation ͉ Barack Obama ͉ gender differences