On a cold November evening last year, the crew of “Babylon Berlin” was preparing for a tricky shoot outside a theater in the German capital. The final season of the long-running show is set in the Weimar Republic during Hitler’s rise to power, and the scene called for a group of Nazi henchmen in swastika armbands to disrupt a crowd. But because Third Reich symbols are banned in Germany, special measures were required.

Tall barriers had been erected around the shoot’s perimeter to hide it from onlookers, and the swastikas were to be hidden when the crew was not filming. The song that the actors would sing — a banned propaganda song called “The Horst Wessel Lied” — would be silently mouthed on-set and then inserted in postproduction.

The show’s latest season — which began airing in Germany last week and will be available to stream on MHz Choice in the U.S. next year — also required its makers to navigate the ethical and logistical baggage of recreating an era with some unsettling parallels to the present.

Germany has outlawed Nazi symbols since after World War II to prevent people from venerating the Third Reich and to avoid traumatizing Holocaust survivors. Exceptions can be made for artistic reasons, but location film shoots that feature Nazi regalia require police approval, with penalties if onlookers see the insignia or uniforms without warning.

For “Babylon Berlin,” a scene involving an antisemitic jeer was recorded with inoffensive wording in public and then retouched in postproduction. Nazi flags were taken down during breaks. Nobody from the public could catch a glimpse of Clemens Schick, the German actor playing Hitler, when he was in costume.

Tom Tykwer, one of the show’s co-creators, said that earlier seasons set before the Nazis’ rise to power had felt less loaded. “I’m happy we avoided it for so long,” he said, adding that recreating the Nazi era on set had “created an extremely uncomfortable feeling.”

Although rules around filming with Nazi symbols have been in place for decades — including Hollywood productions like Quentin Tarantino’s “Inglourious Basterds,” and “Valkyrie,” starring Tom Cruise — Christiane Krone-Raab, the director of the Berlin Brandenburg Film Commission, said that the authorities had recently grown increasingly careful about granting permissions, given the rise of smartphone cameras.

“If a prominent location in Berlin is photographed while covered in Nazi flags,” she said, “it will spread around the world.” Many productions, she added, now avoid any headaches by adding images digitally.

In recent years, Studio Babelsberg, a sprawling movie lot outside Berlin, has built infrastructure to help productions navigate the strict conventions. “I don’t want to say that movies set during the Nazi time is our unique selling point,” said Eike Wolf, who leads the studio’s operations, “but if there’s anything we know how to do, then it’s Nazi films.”

In 2016, Babelsberg built an enclosed street where productions can film exteriors without having to hide banned symbols. “It’s a good place to shoot sensitive scenes,” Wolf said, such as crowd sequences involving extras wearing Nazi-era uniforms. He noted that it had been used to recreate the Warsaw Ghetto three times.

The studio, he added, owns what is probably “the biggest collection of Nazi flags in the world,” as well as numerous period props. Anyone borrowing items with swastikas, he said, has to sign a document acknowledging that they are taking an “unconstitutional object.” Some props, including portraits of Hitler, are kept behind lock and key.

According to David Pieper, a production executive at Studio Babelsberg, the German police take violations seriously. He recalled that the set of Ava DuVernay’s 2023 film “Origin” — which recreated Nazi book burnings in central Berlin — was contacted by police officers after somebody posted a social media photo of extras in Nazi uniforms.

Babelsberg leadership has cultivated political connections to smooth over possible complications. According to Pieper, permission to film “Valkyrie” in Bendlerblock, the Berlin building complex where Stauffenberg was executed, was granted only after an intervention by the office of Angela Merkel, Germany’s chancellor at the time. (Merkel’s office declined to comment.)

In recent years, however, the rise of the far right in Germany has made an unsettling backdrop for filmmakers recreating the period.

Tykwer, the director, said that he had been disquieted by some parallels between the final season of “Babylon Berlin” and recent events. A report by the country’s domestic intelligence service found that the number of far-right extremists in Germany had increased nearly 15 percent last year. The far-right Alternative for Germany party — some of whose leaders have downplayed Nazis crimes — recently secured the largest vote in state elections in Saxony-Anhalt.

Tykwer emphasized, however, that any parallels were accidental and that he and other producers had always intended to end the show once the Nazis took power. The dramatic rise of the far right in Germany was inconceivable, he said, when they came up with the show’s overall arc 13 years ago.

“We never had a plan to make a show that is so radically reflective of our time,” Tykwer said. “The world is so much more fragile than we’d thought.”