Hungary represented a curious sideline during World War II: only recently made independent, it was unique in being an ally of Hitler where Jews were nonetheless generally tolerated for much of the war’s duration despite much local anti-Semitism—until the Germans intervened directly in 1944 and began rounding them up for deportation. That history provides the backdrop for “Walking With the Enemy,” an intriguing, though cinematically prosaic and factually loose, account of a Hungarian Jew who used a dead officer’s uniform to save hundreds of his countrymen from death in the concentration camps. The film is an example of promising material inadequately handled by first-time director Mark Schmidt.

Jonas Armstrong stars as Elek Cohen, a character modeled after Pinchas Tibor Rosenbaum, who became a member of the underground Zionist resistance after the Nazi takeover. His primary interest is in locating the other members of his family, who have been taken off to the camps. But in the process of protecting young Hannah (Hannah Tointon) from a couple of German officers, Cohen kills them; and when a friend’s work with Swiss diplomat Carl Lutz, who was instrumental in securing Swiss citizenship papers for endangered Jews, gets him put into a prison cell, Elek dons one of their uniforms to rescue him. The ruse works so well that Cohen continues it, outsmarting both Germans and members of the Hungarian fascist group, the Arrow Cross, art turn after turn, though not always without cost to his own cause.

There’s some obvious tinkering with historical fact in this. The uniform that Rosenbaum wore was in fact one of the Arrow Cross, not the Wehrmacht or the Gestapo—which makes all his interaction with the German officer corps tendentious at best, and his recurrent confrontations with Arrow Cross members even more so. It would also have been beneficial for picture to portray the Hungarian head of state, Regent Miklos Horthy, played soberly by Ben Kingsley, in a more accurate light. He was actually a very complicated figure, whose attitude toward the Jews was less benign than depicted here. By giving him a heroic aspect in emphasizing his opposition to the more virulent Hungarian anti-Semites even as he expressed anti-Semitic attitudes himself, the script does less than justice to the real suffering of Hungarian Jewry even in the years preceding 1944, when he was clearly in charge.

Still, the film performs a real service in highlighting the courage of Lutz (William Hope) in his efforts to save as many Hungarian Jews as possible, and it’s certainly valuable to have Adolf Eichmann (Charles Hubbell) portrayed as the monster he was—the cold, calculating but cowardly overseer of the Final Solution in Budapest.

And while one can’t have confidence in the historical veracity of all the individual elements of the picture’s narrative, its overall thrust is intriguing as a tale of Jewish resistance in the face of Nazi brutality. One can also appreciate the film serving as a useful backdrop to Holocaust survivor Elie Wiesel’s account of his own experiences in the Hungary of 1943-45 (in his memoir “Night”). Wiesel was, after all one of the half-million Hungarian Jews taken to the death camps under the Nazi occupation, and his remarkable testimony about what befell them puts Rosenbaum’s—or in this case, the semi-fictional Cohen’s—efforts in perspective and makes them all the more extraordinary.

Given that, it’s unfortunate that Schmidt’s work in bringing the story to the screen isn’t more nuance and well-structured. There’s a scattershot, often clumsy feel to the film, with the episodes not smoothly organized; and one sometimes has the impression that the makers were more concerned with the physical period details (nicely realized by production designer Christian Niculescu) than the narrative arc. And at the close “Walking With the Enemy” strains melodramatically for a sense of inspiration and uplift.

Nor is the acting of the best. Armstrong is solid enough, but many of the secondary performances are only fair, and Kingsley’s stolid turn as Horthy seems a walk-through.

“Walking With the Enemy” tells a story worth hearing. Unfortunately, in the filmmakers have altered and exaggerated it in the interests of conventional action-film expectations. As so often happens, the truth is more powerful than the fiction they’ve surrounded it with.