Location shooting of exterior backgrounds began in Berlin the summer of 1947. When Wilder arrived, he saw that the city had cleaned up a little since he was there right after the end of the war, but the results of close to 400 Allied bombing raids were still very much evident. Nearly half a million of the city's buildings had been destroyed, and although resilient Berliners were finding ways to survive, food was still scarce, the black market was thriving, and military police were everywhere. Filming in this virtual war zone suited Wilder's purposes very well, since he needed to show a destroyed city in chaos.

German-born film producer Erich Pommer had been placed in charge of the film section at the U.S. government's Information Control Division in Berlin. He helped the production by arranging for the recently reconstituted German film studio Ufa to advance the production's expenses in deutschmarks.

Because there was no raw film stock to be found in Berlin, the production had to bring its own from America.

Wilder and his crew filmed throughout Berlin for nearly a month. Their footage appears as rear projections in several scenes of the finished movie. It also forms the basis of a typically sardonic visual joke: as Captain Pringle rides through the ruins carrying a mattress he bought for his German mistress on the black market, the soundtrack plays the sweet tune "Isn't It Romantic?"

Upon completion of location shooting in early September, Wilder headed back home by way of Paris, where he stopped in to see Marlene Dietrich to convince her to take the part of the German cabaret singer and former Nazi official's mistress. Dietrich had spent most of the war traveling among Allied troops, justly lauded for her anti-fascist efforts, often at the front lines, popping back to the States only occasionally for movie roles. Her immediate reaction when Wilder brought his offer to her at the Hotel Georges V where she was staying was a quick and vehement no. She had no intention of playing a woman with a Nazi past, but Wilder wouldn't take no for an answer. He swayed her with the promise that her songs in the picture would be written by her old friend and frequent composer Friedrich Hollaender. One story has it that eventually he showed her screen tests of other actresses he claimed to be considering for the role and that did the trick (reportedly, one of them was June Havoc), although Wilder denied that such a ploy was ever used. More likely what swayed her was the fact that her screen popularity had waned and she needed a hit movie. It also helped considerably that she would be paid $110,000 with an additional $66,000 promised for overtime.

In a biography of her famous mother, Dietrich's daughter Maria Riva wrote, "She left for Hollywood in '47, quite sure that once she had designed the clothes, sung the Hollander songs, and made sure that 'Billy won't insist that the woman was really a Nazi during the war,' A Foreign Affair would become a Dietrich film."

Wilder thought he would also have to do considerable coaxing to get his choice for the role of Congresswoman Phoebe Frost (a name no doubt chosen to suit the character's personality). Jean Arthur had not made a movie since 1944. Weary of acting and the attendant publicity after more than 20 years in the business, she decided to drop out in favor of enrollment in Stephen's College in Columbia, Missouri. "I've had to work all my life, and now I want to learn," she said. But Wilder offered her top billing and $175,000 with an extra $10,000 for four additional weeks work. Arthur dropped out of school with only two weeks remaining before final exams.

Studio filming began in Hollywood in December 1947 and continued into February.

Dietrich moved into Wilder's house during production, and the two friends had a great time together, on set and off. She was always eager to oblige when Wilder prodded her about affairs with both sexes. Future director Gerd Oswald, then assistant to Wilder, said it was rumored that Dietrich was having an affair with everyone, particularly "a couple of muscle-men stunt guys she just devoured." John Lund called her a "mixture of siren and homebody, gracious, unfailingly professional and funny," and related a story about Winston Churchill's son, Randolph, making such a pest of himself pursuing Dietrich on a visit to the set that Wilder's wife finally threw a glass of wine at him.

Dietrich reportedly didn't think too highly of her co-stars, calling Lund "that piece of petrified wood" and referring to Arthur as "that ugly, ugly woman with that terrible American twang."

Mirroring the triangle in the plot of the movie, Arthur and Dietrich vied with each other for Wilder's attentions, with Dietrich usually coming out far ahead. Although this was their first picture together, the two Europeans were old friends, and they would frequently be off in a corner of the set, talking in German and giggling. Sometimes Wilder went to Dietrich's dressing room for lunch or tea. All of this had Arthur seething, compounded by the fact that she was always insecure about her looks and knew she was playing the Plain Jane to Dietrich's Glamour Girl in this film. Reportedly, she showed up at his house one night with her husband, producer Frank Ross, visibly shaken and eyes red from weeping. She demanded to know what he had done with a certain close-up of her, "the one where I looked so beautiful," and accused Dietrich of having forced Wilder to burn it. One story claimed he eased her concern by showing her the close-up, but Wilder always said no such shot ever existed.

"What a picture," Wilder said in frustration to John Lund. "One dame who's afraid to look in the mirror, and one who won't stop."

For the scene in which Arthur's character gets drunk and ends up being tossed in the air by rowdy soldiers, Wilder wanted to use a double, but Arthur insisted on doing it herself. After the physically strenuous take, she said loudly and pointedly, "What will you require next from me, Mr. Wilder," to a round of sympathetic applause from the crew.

Wilder biographer Maurice Zolotow claims that one of the big clashes Wilder and Brackett had on this picture was over Marlene Dietrich's first scene. She is introduced in her bombed-out shell of an apartment, brushing her teeth, and when John Lund, as her American GI lover, comes near her, she spits in his face, Zolotow says Brackett was so offended by the scene and by Wilder's flippant defense of it that he threw a phone book at the director's head.

As soon as shooting was over, Dietrich sped to New York to be with her daughter, Maria Riva, who was pregnant with Dietrich's first grandchild.

Seven-time Academy Award winner Edith Head designed the costumes. Or as she later put it: "You don't design clothes for Dietrich, you design them with her."

Future Emmy-winning editor John Woodcock, assisting in the cutting of the picture, recalls a moment when Wilder was reviewing the footage he shot in Berlin. Seeing aerial shots of block after block of leveled buildings, Woodcock remarked that he felt a little sorry for the Germans. Wilder jumped up in a rage: "To hell with those bastards! They burned most of my family in their damned ovens! I hope they burn in hell!"

by Rob Nixon