Hugh Jackman explains how he became Gary Hart in 'The Front Runner'

Hugh Jackman hasn’t been inside a classroom for decades, but that doesn’t mean he has stopped doing his homework. The 50-year-old Australian star of the X-Men franchise used his latest film, The Front Runner, as an excuse to take a deep dive into 20th century American political history.

Set in 1987, the Jason Reitman-directed feature depicts the turbulent final weeks of former Democratic presidential candidate Gary Hart’s ill-fated campaign, which collapsed amid rumors of his infidelity. “I was fascinated by it,” Jackman tells Yahoo Entertainment about the opportunity to embed himself in the recent past. “This is my college, right? I get to do a political science class for five or six months.” (Watch our video interview above.)

According to Reitman, Jackman was a star pupil from the beginning; on the first day of shooting, he wowed his director by re-creating an entire debate that Hart had with then-Sen. Bob Dole, who was seeking to become the Republican Party’s presidential nominee in 1988, with minimal preparation. “Hugh is a voracious reader,” the Tully director says, admiringly. “He memorized speeches that were not even in the film! There was a day where I needed him to do a speech that was not in the script, and he just knew it. He had five notebooks of Gary Hart history.”

For his part, Jackman credits Reitman with aiding his transformation by keeping him on his toes. In the press-conference sequences, for example, the director would use the script as a general guide but assign different questions to different actors, who would ask them in a different order. That created an atmosphere in which Jackman had to always be thinking and speaking as Hart so he could always respond in the moment and in character.

The fact that he befriended the real Gary Hart in the course of shooting The Front Runner made Jackman take his assignment even more seriously. “Gary is a friend of mine, and I really care about him,” he says, with obvious admiration in his voice. “I care about his legacy. I wanted him to know how seriously I took it. I wanted to be able to go to sleep at night knowing I did everything I possibly could.”

The Front Runner opens in select theaters on Tuesday and goes into wide release on Nov. 21.

Watch: Hugh Jackman vs. Ryan Reynolds in fake political ad:


Read more from Yahoo Entertainment: