President Obama may have a fictional boy wizard to thank for his election.

Anthony Gierzynski, a political science professor at the University of Vermont, believes the moral lessons in the Harry Potter series “played a small but not insignificant role” in the president’s elections in 2009 and 2012.

Harry Potter and the MillennialsIn his new book, "Harry Potter and the Millennials: Research Methods and the Politics of the Muggle Generation," Gierzynski argues that Millennials — those born in the early 1980s through the early 2000s — were so taken by the series’ portrayal of good and evil that it influenced their votes.

"The lessons fans internalized about tolerance, diversity, violence, torture, skepticism and authority made the Democratic Party and Barack Obama more appealing to fans of Harry Potter in the current political environment," he told The Daily Mail.

To prove his theory, Gierzynski interviewed and surveyed more than 1,000 millennial-aged U.S. students from seven universities between 2009 and 2011.

The survey asked students about the Harry Potter books and movies and the degree to which they interacted with the series. While some students were diehard “Potterheads” who’d read all the books before the movies came out, others had only seen the movies. Some students had never read the books or seen the films.

Gierzynski found that 60 percent of Obama voters in 2008 were Potter fans and that 83 percent of them viewed George W. Bush negatively.

"Attitudes in opposition to the use of violence, torture and deadly force came to be associated with the Democrats at the end of the Bush years, mainly in opposition to Bush administration policies and failures in these areas," Gierzynski said.

"Again and again, whether it is ignoring status as a pure-blood to judge individuals on the quality of their character, or simply courtesy toward any person regardless of their appearance or societal position, the tale of the boy wizard teaches it is good to reserve judgment, to be open to those who are different," he writes in his book. "By contrast, the stories' antagonists are often quick to make judgments and be quite vocal in their bigotry.”

More Harry Potter stories on MNN:

Laura Moss writes about a variety of topics with a focus on animals, science, language and culture. But she mostly writes about cats.

Did Harry Potter help Obama get elected?
A new book argues that the Potter series' moral lessons helped young voters identify with Democrats and cast their votes for Obama.