Along with Gone with the Wind and Citizen Kane, Casablanca is probably the greatest example of the classic Hollywood film. Shot entirely on Hollywood sets, using studio actors, directors, and writers, Casablanca perfectly displays the art of collaborative studio production, rather than the vision of a single, independent auteur. With its black-and-white earnestness, hardboiled male lead, and beautiful, demure heroine, it is a paradigmatic film from Hollywood's golden age. The story itself is straightforward, but the film is hardly simplistic, partly because of its unresolvable central conflict and partly because it functions as both a realistic movie and a political allegory. The film's lasting enchantment is due to its dramatic conclusion.
Casablanca may be a classic Hollywood film, but it lacks a classic Hollywood ending, in which everyone rides happily into the sunset. For Casablanca to fit this outline, Ilsa would have to declare her love for either Laszlo or Rick and leave with her choice, and the rejected male would let her go without a struggle because his love was so great that above all else he wished for her happiness. Casablanca's ending resembles the classic ending, but it has been twisted and complicated.
In the standard Hollywood film, no conflict would arise between the political and the personal. Love and political idealism would go hand in hand, and no painful choices would be necessary. The conclusion of Casablanca involves much more than the triumph of the idealistic values of sacrifice and restraint, and Casablanca is much more than pro-Allied propaganda. If the film concluded with the simple message that victory requires sacrifice, then the ending would be a happy one. Rick's decision to let Ilsa leave with Laszlo would privilege long-term concerns over short-term ones. In exchange for love today, victory and freedom will prevail in the future. Laszlo may think of his actions similarly. He will sacrifice himself today by suffering imprisonment in concentration camps and constantly running, in exchange for a better future. Such calculations are consistent with the classic Hollywood happy ending, and, indeed, Laszlo does get the girl in the end, just as we might expect.
For Rick and Ilsa, however, the conclusion is neither as happy nor as simple. Not only do the lovers have to split up a second time, but neither truly knows what the other is thinking. Laszlo undoubtedly loves Ilsa, but Rick's and Ilsa's feelings aren't so clear. The film demonstrates the moral value of sacrifice and the triumph of the political over personal desire, but the final scene is full of ambiguity. Ilsa's true preference for Rick or Laszlo remains a mystery. She suggests that her preference is for Rick when she visits him in his apartment to ask for the letters of transit, but her potential ulterior motive, to do what it takes to get the letters so her true love, Laszlo, can flee to safety, adds an element of doubt to what she says and does. In the final scene at the airport, Ilsa may fail to declare her love for Rick because Laszlo is never far from earshot, but she may also refrain from declaring her love because she doesn't want to lie again. She leaves with Laszlo in the end, but in a way, Rick has forced this decision on her, and which of them she truly loves remains a mystery.
Rick's feelings are almost equally ambiguous. He seems to truly love Ilsa, and his final gesture, when he not only lets Laszlo and Ilsa leave together but tries to patch things up between them by telling Laszlo about Ilsa's visit the previous evening, seems a courageous act of self-sacrifice. Yet we can't know with any certainty that Rick hasn't gotten over Ilsa. Perhaps he realized he couldn't compete against the war hero Laszlo and gave up on her, or perhaps all he really needed from Ilsa before he could move on was to hear her say she still loved him. Rick's final gesture could also be in part an act of revenge, payback for Ilsa's having abandoned him. Perhaps Rick wants to send her into a life of loneliness and solitary whiskey drinking, the same life that he himself has been leading ever since being abandoned at the Paris train station a year earlier.
Rick finds some consolation in his friendship with Louis. Rick is not substituting one relationship with another here—he is substituting one type of relationship with another. Ilsa and Rick's relationship is one based in romantic love, while Rick and Louis's relationship has been and still is one of expediency and political alliance, even if they have now added an element of genuine personal affection. Rick's substitution of Louis for Ilsa at the end of the film underscores the idea in Casablanca that politics trump romantic love, and the public is of greater significance than the personal.
We can only speculate on Rick's and Ilsa's true feelings and motives, and the point is that the ending remains a mystery. It is neither happy nor sad, but both at once, and far from the kind of ending one might expect from a typical 1940s Hollywood film.