“Anna Karenina” may be the high-profile period romance in theaters this awards season, but the Danish film “A Royal Affair” has something else going for it besides sumptuous costumes, a tragic heroine, and forbidden love: It happens to be true. Political intrigue in the court of 18th-century Danish King Christian VII (Mikkel Boe Folsgaard) and the adulterous romance between his wife, Queen Caroline Mathilda (Anna Vikander) and royal physician Johann Struensee (Mads Mikkelsen) may be unfamiliar to audiences in the United States, but it’s well known even to schoolchildren in Denmark.

“It’s a big responsibility when you’re doing a film where everybody knows the story. Filmmakers have been trying for 30 years to bring it to the screen,” says writer-director Nikolaj Arcel during a visit to Boston. Although Arcel’s resume includes a political thriller, an epic fantasy, and the screenplay for the original version of “The Girl With the Dragon Tattoo,” historical romance wasn’t part of his oeuvre. With frequent collaborator Rasmus Heisterberg, a fellow graduate of the prestigious National Film School of Denmark, he spent a year researching the famous story. “We wanted to be sure to get as close to the truth as possible,” says Arcel, 40, in flawless English. It was only by giving equal weight to both the romantic triangle and the sweeping social changes that Queen Caroline and Struensee conspired to enact through the weak king that Arcel knew his story would resonate with modern audiences.

“I was very conscious of the political relevance,” says Arcel. “The world was slightly different but overall things were the same: Political enemies tried to destroy one another. I also thought it was interesting to reexamine the Enlightenment in terms of [contemporary questions]. What do we want for our country, our world? Johann is a true idealist but he was an amateur, not a politician. If he was more of a politician, he could have managed to implement his ideas. But he didn’t know how to work with others in the court.”

Although “A Royal Affair” is now Denmark’s entry for the best foreign-language film Oscar this year, there were still skeptics who told Arcel that he was likely to fail just as so many other screenwriters had. “But that’s been the story of my life,” he says. “My first feature [“King’s Game” in 2004] was a political thriller, which was insanely out of fashion then. But people loved it. Then I did a big fantasy film, ‘Island of Lost Souls’ [2007], which was my Spielberg film. I can’t for the life of me figure out why people don’t trust me. Danish people don’t just want small films about family.”

Get The Weekender in your inbox:

The Globe's top picks for what to see and do each weekend, in Boston and beyond.

The script was good enough to convince Mikkelsen, the Danish screen star who this year won best actor honors at Cannes for “The Hunt” and will soon play Hannibal Lecter in an upcoming NBC series, to take the role of the German doctor Struensee. The earthy Struensee, a devotee of the Enlightenment, uses his friendship with King Christian to access the halls of power and the intelligent but unhappy young queen who left her privileged life in France for an arranged marriage to the spoiled, childish, increasingly deranged king.

Magnolia Pictures

Mikkel Boe Folsgaard and Mads Mikkelsen.

Vikander, 24, the suddenly-everywhere young actress who also stars in “Anna Karenina” as Anna’s sister, Kitty, was cast in “A Royal Affair” as an unknown. She says she’d never heard the story growing up in her native Sweden. But when she read the script, she was taken with young Queen Caroline and her quest for social and political reforms. “I did extensive research for the role. I read a book of letters compiled when Caroline was just 15,” says Vikander over the phone from New York. “She spoke four languages; she quoted Voltaire.” The only problem was that Vikander, who speaks fluent English, didn’t speak Danish. Arcel cast her on the condition that she learn Danish in two months, which she did.

Arcel says he’s wanted to make movies ever since, as a 10-year-old captivated by American films in his native Copenhagen, Steven Spielberg’s “E.T.” inspired him to pick up a Super 8 camera. “I am called ‘the American director’ in Denmark because I’ve been influenced more by American than European films,” he says. Hollywood epics helped him shape “A Royal Affair.” “It was a different brand of storytelling. It had a literary approach to the structure of the film, more like reading a novel. I love those films. I was inspired by ‘The Lion in Winter,’ and ‘Gone With the Wind’ in its setting a love story against the Civil War, the juxtaposition of love and politics.”

Arcel is part of a cadre of young directors from Denmark that includes Thomas Vinterberg and Lars von Trier, the controversial dean of Danish filmmaking. “Lars is a good guy. He wants you to succeed. But he says, ‘The moment you start getting awards I’ll try to destroy you,’ ” laughs Arcel. “As long as he is number one, then he’ll help you.”

When both Arcel’s script and Folsgaard as best actor earned honors at this year’s Berlin Film Festival, Arcel says von Trier looked at him askance. “I told him, ‘We got Berlin, but don’t worry. You’ll get Cannes.’ ”