Researchers led by Sofia Stathi of Greenwich University, in southeast London, and Loris Vezzali, of Italy's Modena University, talked to children before they read a Potter book or watched one of the eight films based on the novels.
Some were asked to focus on a scene exploring prejudice in which Draco Malfoy, a pure-blood wizard, calls Potter's friend Hermione Granger a 'filthy little Mudblood', an insulting term for children with human blood in their veins, and her reaction to it.
A week later the team questioned the groups again and found those exposed to the Malfoy scene were more sympathetic towards homosexuals than those who had read or seen the wand section.
Students who experienced the Malfoy incident were also found to be less aggressive towards refugees and immigrants than those who experienced the wand episode.
The team concluded that "reading the novels of Harry Potter improves attitudes towards stigmatised groups and contact with fantasy characters can improve attitudes towards dissimilar out-groups".