Originally planned as a reunion between the writer (Leo Marks) and the director (Michael Powell) of Peeping Tom (1960), this was inspired by Marks' own wartime career as an ace code-breaker. However, the notoriety of "Peeping Tom" made it hard to get the project off the ground. Powell became connected with American producer Herbert Brodkin during the making of the television series Espionage (1963), and hoped that Brodkin's interest would get this movie made. When it finally was, he and Marks were replaced. Powell had to be content with a producing credit, while Marks was credited solely with the story.
Michael Powell was a producer on this movie, and chased many actors to play the lead. The one he wanted most was Rex Harrison. To make Harrison envious and to persuade him to play the part, he also offered it to several other hot actors. He found Christopher Plummer in the south of France, Peter O'Toole in Dublin, and Patrick McGoohan on an "MGM" soundstage and tried to sign them. Harrison kept dithering, and in the end, after also considering Sir Michael Caine, and at a cost of seventy-five thousand to one hundred fifty thousand dollars, David Warner, the title role eventually went to Sir Dirk Bogarde, who never saw himself right for the part.
Sir Dirk Bogarde was invariably very unwilling to do promotional work for his movies, so it was a surprise when, at the time this movie opened in New York City, he did a series of interviews for American radio and on local television talk shows to advertise it. His reason was, however, unconnected with any enthusiasm for the movie. He had been vacationing in the U.S. and had run out of money, and so agreed to do this work in return for Paramount Pictures paying his expenses to get home.
Sir Dirk Bogarde (Sebastian) said, "I was so unhappy and disenchanted that I kept my shirt on in one of the bed scenes."
Director David Greene suggested Dame Helen Mirren for the role of Rebecca Howard. Michael Powell cast her in his next movie, "Age of Consent (1969)."