“The Exception” is a handsomely mounted World War II-era romantic thriller, enlivened by vibrant performances and vivid sexual encounters and inspired by a little-known footnote to history, the story of a ruler who left but never went away.

That would be Germany’s Kaiser Wilhelm II, engagingly played by the veteran Christopher Plummer. Though the kaiser exited history’s stage when he abdicated in 1918, Wilhelm lived on in exile in the Netherlands for more than 20 years, a span that inspired Alan Judd’s novel “The Kaiser’s Last Kiss” on which the current Simon Burke screenplay is based.

Though the kaiser’s presence anchors the thriller parts of the story, the romance is more than capably handled by the considerably younger pair of Lily James, madcap heiress Lady Rose in “Downton Abbey,” and Australian hunk Jai Courtney.

As put together by British theater director David Leveaux, making his theatrical feature debut, “Exception” breaks no new ground but is a solidly done and always engrossing piece of alternate history, mixing real people and events with fictional ones.

The year is 1940 and topping the fictional list is German army Capt. Stefan Brandt (Courtney), a brooding and enviably fit third-generation officer who is being held back from active duty because of some initially unspecified “business with the SS in Poland.”

When his new assignment comes in, the captain is not happy about it. He’s to go to the Netherlands to take command of the personal bodyguard of a man he’s assumed was dead, a man he’s told in no uncertain terms has “tremendous symbolic importance to the German people.”

The kaiser harbors the not exactly realistic hope that the former ruler will, if he plays his cards right, be called back to the German throne as “the physical manifestation of God’s will on Earth.”

Speaking of thrones, talk of politics could turn Wilhelm apoplectic in an instant, screaming in fury at being stabbed in the back by the military at the end of World War I and excoriating Hermann Goring as “that oaf” who had the temerity to come to lunch wearing plus fours.

Capt. Brandt, for his part, is bemused by the kaiser but more deeply interested in the fetching Mieke de Jong (James), a servant girl who is the newest member of Wilhelm’s household.

Much more serious stuff of course is also taking place. There are strong rumors that a British spy is active in the vicinity, the dread Gestapo orders the captain to keep tabs on the kaiser’s visitors, and there is even the chance that top Nazi Heinrich Himmler (Eddie Marsan) will pay a visit.

These and other World War II thriller aspects, including deception and even genteel references to torture, get more prominent as “The Exception” goes on, but the truth is the erotic chemistry between James and Courtney is so evident that it’s mostly what we care about.

MOVIE REVIEW

“The Exception”

Grade: B

Starring Lily James, Jai Courtney and Eddie Marsan. Directed by David Leaveaux.

Rated R for sexuality, graphic nudity, language and brief violence. Check listings for theaters. 1 hour, 47 minutes.

Bottom line: Solidly done though breaks no new ground