Robert Clary, a French-born American actor who survived 31 months in a Nazi concentration camp, but later had no doubts about starring in Hogan’s Heroes, an American sitcom set in a German POW camp during world war II, died at the age of 96, Reuters reports.

Holocaust survivor actor Robert Clary has died at the age of 96Photo: Chris Pizzello/AP/Profimedia

Clary, who played French Corporal Louis Lebeau on “Hogan’s Heroes” for six seasons from 1965 to 1971, died Wednesday at his home in Los Angeles, his niece told The Hollywood Reporter.

“Robert was a wonderful gentleman and incredibly talented, not only as an actor, but also as a performer and talented artist,” said David Martin, his former manager.

Clare was 16 years old in September 1942 when he was deported from Paris to the Nazi concentration camps along with 12 other members of his Jewish family. He was the only survivor. Clary spent two and a half years in the Ottmuth, Blachhammer, Gross-Rosen and Buchenwald concentration camps, enduring hunger, disease and forced labor.

He was released when American forces liberated Buchenwald in April 1945, but then learned that members of his family, including his parents, had died in the Holocaust.

Ironically, Clary rose to fame playing a series about a German prison camp. He said he had no problem being in a show that mocked Nazis.

His hero was one of the POWs who deceived their German captors and engaged in espionage and sabotage to help the Allied cause.

“The show was a satire set in a POW camp, where the conditions were unpleasant but not at all like a concentration camp, and it had nothing to do with Jews,” Clary told the Jerusalem Post in 2002.

Clary was born Robert Max Wiederman on March 1, 1926. She was the youngest of 14 children of her Polish tailor father. As a teenager, he became a professional singer.

In the camps set up by the Nazis to exterminate Europe’s Jews, he was tattooed with the number A-5714 and forced to dig trenches, work in a shoe factory and sing for his fellow prisoners. Singing got him a few more bites of food, Clary said.