Jai Courtney plays Stephan, a Nazi soldier who falls for a Jewish woman in “The Exception.” (Johan Voets/A24 Films)

Set against the backdrop of Germany’s 1940 invasion of the Netherlands, “The Exception” is a tense romantic thriller made up of equal parts suspense and nudity.

Jai Courtney plays Stefan Brandt, a captain in Hitler’s army tasked with keeping an eye on Kaiser Wilhelm II (Oscar-winner Christopher Plummer), who’s in exile in Holland. With reports of a British spy in the area, Stefan might be called upon to thwart an assassination attempt — or face dire consequences.

The young soldier is hard to get a read on, but this much is clear: He’s haunted by nightmares, he bears a mysterious, sexy scar across his six-pack abs and, when he sees a woman he likes, he doesn’t mince words.

“Take your clothes off,” he orders Mieke (Lily James), one of the Kaiser’s maids, upon only their second encounter. Apparently not one for small talk either, she complies.

So begins an unlikely affair — between a Nazi and a Dutch servant who’s harboring a few secrets (including Jewish ancestry). Stefan, however, doesn’t care about such things; he’s not one of those German soldiers. Naively, he believes that most Nazis share his enlightened view.

Lily James stars as Mieke. (Johan Voets/A24 Films)

Another story unfolds alongside this lust-fest, and it’s a deeper one about dashed hopes focusing on Wilhelm and his wife, Princess Hermine (Janet McTeer), both of whom fantasize that Hitler might invite them back to reclaim their throne and former lives. In the meantime, Wilhelm spends his days chopping wood in the forest or feeding ducks by a lake. His most important decision is what to tell the cooks to make for dinner each evening.

The two veteran actors are as good as ever, especially Plummer, whose character swings from cuddly to irate. Wilhelm takes a shine to Mieke, and they form a sweet bond, one that’s complicated for the audience by her uncertain motives.

Theater director David Leveaux maintains a firm grip on pacing, scene-setting and character-development, keeping the protagonists sympathetic, while raising the stakes. The danger ultimately becomes real, especially for Mieke, when Heinrich Himmler (Eddie Marsan, genuinely terrifying) decides to pay Wilhelm a visit. Suddenly, the real-world consequences of Hitler’s Final Solution become clear.

The final act is a nail-biter, reinforced by composer Ilan Eshkeri’s clever score, which incorporates the sounds of telegraph transmissions, reminding us that espionage is never far away.

But the story starts to fall apart as it nears the climax. Wilhelm — once an intriguingly volatile character — starts looking more and more like a magical fairy godfather. But all is not entirely lost. For all its late-in-the-game silliness, “The Exception” is a solidly acted, well-told tale about how love of country holds up in the face of other, less nationalistic passions.

R. At the Avalon. Contains sexuality, graphic nudity, language and brief violence. 107 minutes.