Just outside High Wycombe, a former tobacco machine factory has been transformed into Auschwitz. It is being used as a location for Denial, a film about the astonishing legal battle fought 20 years ago by Deborah Lipstadt, at the time a little-known American academic who specialised in the Holocaust. When Lipstadt and I meet on set, it is her first day in the recreated concentration camp.

“It’s very real,” she says, as we watch extras queuing to go down steps to the crematoria. “I mean how do I know? I wasn’t there. But it feels very real. It’s very, very powerful.”

As the actors file off for lunch, Mia Farkasovska, a bright-faced 9-year-old, who is wearing a scruffy brown jacket with yellow star attached, comes over to where we are standing to collect a warm coat. Lipstadt stops her to chat, asking if she has got the day off school to be in the film. Then the academic asks: “Do you know what the film is about?”

“Yes,” Mia says. “It’s about this man who said that the Holocaust never happened. And then this professor, who is called Deborah has to prove it did happen. And she wins.”

Mia is spot on. Denial is the story of a five-year long case that finally came to court in 2000. In the records it is listed dryly as David Irving v Penguin Books and Deborah Lipstadt. But at the time it was hailed as nothing less than history on trial. It was a battle not just over the factual details of how six million Jews were killed in the Holocaust, but over how we record our past, about the sacredness of facts and the fragility of memory. Sixteen years later, it has reached the big screen.

“Do you know what my name is?” asks Lipstadt. The girl answers “no”.

“I’m Deborah.”

“Oh. It’s you,” the girl cries, lighting up. “It’s amazing to meet you. It’s great what you did. And it’s horrible he denied it.” She looks thrilled to have met the professor, who is beaming with pride.

Lipstadt says: “Can I give you a hug?” After they embrace, she adds: “Thank you for helping us make this film.”

Lipstadt, now 69, never asked to appear at the Royal Courts of Justice 17 years ago. Until then, she had ploughed a narrow furrow of academic research: the Holocaust, and specifically how the horrors of Hitler’s final solution were remembered and misremembered. Lipstadt describes herself as “an egalitarian conservative Jew” – her father escaped Europe in 1927 before Hitler came on to the scene, her mother was born in Canada; they met at their New York synagogue. Lipstadt’s 1993 book, Denying the Holocaust: The Growing Assault on Truth and Memory, was well received – but only among historians and those studying Judaism.

After writing it, she went back to teaching at Emory University, in Atlanta Georgia, where she still teaches and lives on her own. She went on to write a number of well-received books on modern Jewish history, including The Eichmann Trial. But her peace was interrupted in 1995, by a letter from her publishers informing her Irving was suing her for libel – a letter she initially did not take seriously.

At barely 5ft, she looks and sounds every inch the New York Jewish academic she is. She talks both incredibly fast and in a thick Queen’s accent, with a liberal scattering of chuckles and Yiddish phrases, but with that tell‑tale academic tick of footnoting every sentence as she goes along, keen that I should not misinterpret anything she says.

She is also clearly enjoying being on set, advising the producers and seeing Rachel Weisz bring a glamorised version of herself to the screen. “She is a great beauty,” says Lipstadt. “It is amazing. I dressed nicely for the trial, but I am not elegant: I am a professor!” she exclaims with glee.

Glamourised … Rachel Weisz as Lipstadt in a scene from Denial. Photograph: Laurie Sparham/AP

Timothy Spall is playing Irving, a once successful, popular historian, who specialised in writing about the Third Reich. A number of leading historians, including Hugh Trevor-Roper, took him seriously and praised his research. Throughout the 1980s, however, his revisionist views about Hitler became increasingly extreme. The Nazi regime did not systematically order the murder of millions of Jews, he said; in fact, there were no gas chambers at Auschwitz.

By the early 1990s he had come to the conclusion that the holocaust was a “myth”, a “legend based on baloney”, confected after the war by Jews to bolster reparations that West Germany paid to the State of Israel. But when, in her book, Lipstadt described Irving as a “Holocaust denier” – part of an alarming trend of rightwing agitators who tried to either downplay or claim Hitler’s final solution never happened – he sued for libel.

It remains a mystery why Irving wanted to sue anyone who accurately reported his views. “I think he thought I was an American, who was far away, I was a woman, that I wouldn’t fight back,” Lipstadt says. “He also thought he’d get publicity.”

But Denying the Holocaust had been prompted by a survey that suggested as many as 22% of Americans thought the Holocaust might not have happened. This figure, combined with the rise of neo-Nazism in Europe, alarmed Lipstadt.

If I had lost the case, it would be illegal to say the world’s leading Holocaust denier is a denier

“Lots of people told me not to fight, including leaders of the Jewish community, who were fearful that I was giving him a platform,” she says. “Many of them told me to settle. Don’t fight, ignore it. But if I lost, it would become illegal to call the world’s leading Holocaust denier a denier. And what he would then say is, ‘Ok, I’m not a denier, but the court ruled in my favour, ipso facto, the David Irving version of the Holocaust is the genuine version.’”

Lipstadt was nervous about giving Irving a platform. The opening scene of the film depicts the moment in 1994 when Irving gatecrashes one of her university lectures, waves $1,000 in the air and says he’ll give it to anyone who can produce written evidence that Hitler ordered the final solution. He then calls her a coward for refusing to debate.

“I was a deer in the headlights,” she says. “I didn’t know what to do. If I started debating with him it would suggest to students that there were two sides. If I didn’t debate it suggested I was afraid.”

Lipstadt is a fierce advocate of free speech. She believes it is wrong to outlaw Holocaust denial, as both the German and Austrian governments have done, and argues against the proliferation of “safe spaces” at universities; calling the trend for allowing students to miss lectures they may find offensives “a coddling of students and coddling of ideas”. She maintains, however, that Irving’s right to free speech did not mean she should debate with him. “You’re allowed to stand up at Hyde Park Corner and say the Holocaust didn’t happen. But do I have to invite you Cambridge or Yale to give you a platform to say so? No. There are not two sides to every story. You can argue [about] why the Holocaust happened, but not that it happened.”

The libel case, when it finally came to the Royal Courts of Justice, was a huge risk – not just financially (costs ran to an estimated £2m), but to Lipstadt’s reputation. She was branded by Sir John Keegan, the respected military historian, as “self-righteously politically correct”; he was one of a number of old-guard historians who believed Irving was no more than mistaken in his research, and that Lipstadt was out to make a name for herself – forgetting she was the defendant, not the litigant. Early in the case Irving agreed to settle if Penguin and Lipstadt apologised and destroyed all copies of Denying the Holocaust.

The trial, which went on for 32 days, was far from a foregone conclusion. Lipstadt and Penguin’s legal team, headed by the solicitor Anthony Julius, refused to put any Auschwitz survivors in the witness box, saying to do so would suggest they felt the need to prove the Holocaust’s existence. “Irving doesn’t deny people were taken away to camps. What he denies is the killing process. And there are virtually no survivors to attest to that,” Lipstadt explains. This was part of a wider legal headache: the Nazis systematically destroyed nearly all documents that could verify the gruesome details of Auschwitz’s gas chambers.

David Irving at the High Court, London, in 2000. Photograph: Martin Argles/The Guardian

The main reason, however, not to use the testimony of survivors – many of whom came to court every day to watch – was that Irving represented himself, and revelled in being in court. “We did not want to put a survivor in the witness box to be cross-examined by a man whose motives we assumed would be to humiliate them, to confuse them,” Lipstadt says.

The 355-page judgment (there was no jury) in April 2000 found that Lipstadt had not libelled Irving. It declared that he incontrovertibly was a Holocaust denier and that his comments during the trial confirmed he was an “antisemite” and a “racist”. It destroyed any remaining reputation he had, and after he was refused leave to appeal was declared bankrupt in 2002, unable to pay the estimated £2m costs. He went on to be arrested in Austria in 2005, where Holocaust denial is a crime, and was sentenced to three years in prison.

Twenty years ago, Holocaust denial was a fringe activity, up there with conspiracy claims such as the moon landings were staged in Utah. But since the trial, and particularly in the last year since David Hare’s script for Denial was filmed, these theories have gained more traction. “Post-truth” has become a buzzword, partly as a result of the rise of Donald Trump.

Lipstadt is despondent. “Trump has said: ‘I saw 1,000 muslims dancing in Jersey City on the night of 9/11. Many people saw it. I saw it.’ You would have thought some evidence would have emerged. Some shred of evidence. And he says, ‘Oh, no. I know it. It’s true. 100 people called me and said the same thing.’ There is no need to provide the evidence. Opinion becomes fact.”

When we caught up earlier this month in London, Lipstadt was even more agitated by the state of public discourse, alarmed at how Breitbart News, a rightwing website that championed Trump, is now seen as a reputable source of information: “Irving was to Holocaust deniers what Breitbart News is to the alt-right. Both Irving and Breitbart take lies, and parade them as opinions in order to encroach upon facts.”

“I am very worried that there is a general sentiment out there that you have your facts, I have my facts, and whoever yells loudest wins,” Lipstadt says. “You had it in your country with Brexit. What was that bus with £350m a week on it? In America, we had it with our election.”

“Are parents going to tell their children, you don’t need to believe everything the president says? What does that say to them about truth, about facts?”

In compressing a five-year legal battle into a film lasting less than two hours there has, of course, been some tampering with the chronology, some details left out. But Lipstadt says that every word Irving says during the film version of the trial is taken verbatim from the records, including inadvertently calling the judge Mein Führer and making many racist statements.

“After the trial I heard from survivors repeatedly,” she says. “I still do. And they would always say ‘thank you, thank you, thank you’. It is very weird to be thanked. The trial was complicated, it was hard, it was expensive, it was frightening at times. But someone who lost their family at Auschwitz thanking me?” She puffs out her cheeks in incomprehension.

“I am not a humble person, I’m not particularly self-effacing. But it makes me feel so humble – almost on some level grateful. There are so many people who’d like to stand up to racists, paedophiles, or antisemites. And I had a chance to do it. I was dragged into it, but I had a chance to stand up. And in the course of so doing I was able to defend the dead – their dead, their families who didn’t make it.”

• Denial is released on 27 January in UK cinemas.