"As Time Goes By" was written by lifelong bachelor Herman Hupfeld and debuted in 1931's Broadway show "Everybody's Welcome", sung by Frances Williams, It had been a personal favorite of playwright and high school teacher Murray Burnett who, seven years later, visited Vienna just after the Nazis had entered. Later, after visiting a café in south France where a black pianist had entertained a mixed crowd of Nazis, French and refugees, Burnett was inspired to write the melodrama "Everybody Comes to Rick's", which was optioned for production by Martin Gabel and Carly Wharton, and later, Warners. After the film's release, "As Time Goes By" stayed on radio's "Hit Parade" for 21 weeks. However, because of the coincidental musicians' union recording ban, the 1931 Rudy Vallee version became the smash hit. (It contains the rarely-sung introductory verse, not heard in the film.) Max Steiner, in a 1943 interview, admitted that the song "must have had something to attract so much attention".
"Here's looking at you, kid" was improvised by Humphrey Bogart in the Parisian scenes and worked so well that it was used later on again in the film. He originally used the same line in Midnight. It is also rumored that during breaks, Ingrid Bergman would play poker with other cast members. Since she was still learning English, Bogart would occasionally watch the game, and he added "Here's looking at you" to her poker repertoire.
"Rick's Café Américain" was modeled after Hotel El Minzah in Tangiers.
Humphrey Bogart, Ingrid Bergman and Paul Henreid later reprised their roles for a radio performance of on the CBS radio program "The Screen Guild Players", a war benefit show on April 26, 1943.
Humphrey Bogart's wife Mayo Methot continually accused him of having an affair with Ingrid Bergman, often confronting him in his dressing room before a shot. Bogart would come onto the set in a rage. In fact, despite the undeniable on-screen chemistry between Bogart and Bergman, they hardly spoke, and the only time they bonded was when the two had lunch with Geraldine Fitzgerald. According to Fitzgerald, "the whole subject at lunch was how they could get out of that movie. They thought the dialogue was ridiculous and the situations were unbelievable... I knew Bogart very well, and I think he wanted to join forces with Bergman, to make sure they both said the same things." For whatever reasons, Bogart and Bergman rarely spoke after that.
S.Z. Sakall, who plays the maitre d' at Rick's Cafe, actually has more screen time than Peter Lorre or Sydney Greenstreet.
Madeleine Lebeau, who plays Yvonne, and Marcel Dalio, who plays croupier Emil, were husband and wife at the time of filming. They had not long before escaped the Nazis by fleeing their native France.
Dooley Wilson (Sam) was a professional drummer who faked playing the piano. As the music was recorded at the same time as the film, the piano playing was actually a recording of a performance by Elliot Carpenter who was playing behind a curtain but who was positioned such that Dooley could watch, and copy, his hand movements.
Dooley Wilson was borrowed from Paramount at $500 a week.
Dooley Wilson was, in fact, the only member of the cast to have ever actually visited the city of Casablanca.
Joy Page, who played the young Bulgarian wife, was the stepdaughter of studio head Jack L. Warner. She, Humphrey Bogart and Dooley Wilson were the only American-born people in the credited cast. This film was her debut.
Hal B. Wallis didn't want Humphrey Bogart wearing a hat too often in the film, as he thought it made Bogart look like a gangster.
Sydney Greenstreet wanted to wear something more ethnic to show that his character had assimilated into the Moroccan lifestyle. This idea was nixed by producer Hal B. Wallis who insisted that he wear his now-iconic white suit.
Ingrid Bergman considered her left side as her better side, and to the extent possible that was the side photographed throughout the film, so she is almost always on the right side of the screen looking towards the left regardless of who is in the shot with her. However, there are several shots where she is to the left and Humphrey Bogart is on the right, including the flashbacks to the street scene in Paris (0:41:50) and the scene at the window (0:43:40). There are also several scenes where Bergman is centered between Paul Henreid and Bogart, suggesting the triangle nature of their relationship; in these shots Henreid is usually to the left and Bogart is usually on the right, including the scene where she and Henreid enter the café at just before the famous "Battle of the Anthems" (1:07:40); the scene where Captain Renault arrests Victor Laszlo (1:34:00); and at the end of the final airport scene (1:39:00).
Ingrid Bergman's contract was owned by producer David O. Selznick, and producer Hal B. Wallis sent the film's writers, Philip G. Epstein and Julius J. Epstein, to persuade Selznick to loan her to Warner Bros. for the picture. After 20 minutes of describing the plot to Selznick, Julius gave up and said, "Oh, what the hell! It's a lot of shit like Algiers!" Selznick nodded and agreed to the loan.
Ingrid Bergman's line "Victor Laszlo is my husband, and was, even when I knew you in Paris" was almost cut from the film because during that time it was deemed inappropriate for a film to depict or suggest a woman romancing with another man if she were already married. However, it was pointed out that later in the film she explains that she had thought Laszlo was dead at the time, and the censors allowed the line to stay in.
Howard Hawks had said in interviews that he was supposed to direct Casablanca and Michael Curtiz was supposed to direct Sergeant York. The directors had lunch together, where Hawks said he didn't know how to make this "musical comedy", while Curtiz didn't know anything about "those hill people." They switched projects. Hawks struggled on how to direct the scenes that involved singing, namely the "La Marseillaise" scene. It is ironic to note that most of his other films involved at least one singing scene.