BERLIN — The legend of Erwin Rommel is at the center of a growing controversy surrounding an upcoming TV biopic by one of Germany’s leading production companies.

The recently wrapped “Rommel,” produced by Berlin-based Teamworx for pubcaster ARD, is set in 1944 and focuses on the field marshal as he leads defense preparations for the anticipated Allied invasion of France while dealing with his conflicting feelings toward Adolf Hitler, which swing between loyalty and opposition.

The screenplay, penned by writer-director Niki Stein, has come under fire by Rommel’s family as well as from the historians who consulted with the filmmakers on the production.

Rommel’s son, Manfred Rommel, and his granddaughter, Catherine Rommel, have taken issue with the military leader’s portrayal, which they say depicts Rommel as a Nazi war criminal.

In a recent letter about Rommel, the family wrote: “Yes, he held Hitler in high regard in the beginning because he was a friend of the army,” adding that the mutual appreciation ended in 1942 at the battle of Alamein in North Africa, when Rommel disobeyed Hitler’s order of “victory or death” and retreated with his Afrikakorps in the face of insurmountable odds, saving the lives of many of his men.

Germany’s Nazi past and its World War II heroes present a touchy subject for ARD, which is walking a fine line between depicting Rommel as the beloved, chivalrous field marshal of legend, and the ruthless military leader who supported Hitler and whose image as a national hero was carefully crafted by Nazi propaganda minister Joseph Goebbels.

Stein has said the film is about the conflict felt by “the person, Erwin Rommel, who represents the entire nation, which recognized too slowly and too late that the man it so passionately served was a criminal.”

Historian Cornelia Hecht, who was a consultant for the film, blasted Stein’s script for inaccuracies and for being influenced by the writings of British author and historian David Irving, a Nazi sympathizer and Holocaust denier. Fascist propaganda and the views of extremist die-hard s have no place in the film, Catherine Rommel complains.Yet historian Peter Steinbach, who also consulted Teamworx on the project, defends the use of Irving’s research. “Irving is without doubt a convicted Holocaust denier, but this has nothing to do with the research behind his portrait of Rommel. His account has been used by all Rommel biographers, including Dr. Hecht, as the Rommel catalog of her exhibition shows. But if she is now using the very statements that we owe to Irving to discredit Niki Stein, it shows how weak the substance of her objections are.”

Teamworx topper and “Rommel” producer Nico Hofmann calls the accusations “unfounded and upsetting,” adding that he had been in contact with members of the Rommel family and even invited them to the set and offered to let them watch the editing of the film.

Beta Film is handling international sales for “Rommel.”