Who the hell, who the absolute hell, came up with all those lines?

“Yesterday they were just two German clerks; today they’re the “Honored Dead”,” says Rick to Ugarte of the murdered German couriers.

“I came to Casablanca for the waters,” says Rick. “Waters? What waters? We’re in the desert!” Renault returns. “I was misinformed,” says Rick.

“You plannin’ on goin’ to bed in the near future?” says Sam. “No!” snaps Rick. “You ever goin’ to bed?” Sam asks. “No,” Rick growls. “I ain’t sleepy neither,” says Sam.

“We’ll be there at six!” says Jan. “I’ll be there at ten,” says Renault.

“I’ve got this gun pointed right at your heart,” says Rick. ”That is my least vulnerable spot,” returns Renault.

Not to mention those, you know, other lines. The ones that made it into the vernacular about all the gin joints, and “Here’s looking at you, kid,” and the usual suspects, and always having Paris. It’s brilliant writing that remains fresh today while they’re all gone now, everyone who made the film, in front of and behind the camera. We are left with the celluloid itself, along with a paper trail of studio memos and enough production anecdotes to fill a plane to Lisbon.

Claude Rains, Paul Henreid, Bergman, and Bogart promote Casablanca.

There’s been a lot of water under the bridge, as Sam would say, in the 80 years since Casablanca was released, on January 23, 1943. The film came, it went, it earned Academy Awards and saw theatrical re-releases in 1949 and 1956, and then made its way to late-night television and caught on with a 1960s counterculture that identified with Humphrey Bogart’s wry and self-serving persona. With Casablanca’s renaissance came controversy, as each of the writers involved claimed sole credit for the screenplay.

I decided to play Sam Spade and at this late date sift through mountainous evidence to answer the burning question: who came up with all those lines?

It Takes Two

Today, Hollywood writers are striking because these many decades after the Golden Age, writers are as invisible as they ever were. It doesn’t matter if you wrote “Yippee-ki-yay, motherfucker” or “Nobody puts Baby in a corner” or “I love the smell of napalm in the morning.” Odds are, no matter how many times the lines are recited around a water cooler or at a holiday dinner or on a first date, the writer will be neither remembered nor credited. Nobody stops to say, “As W. P. Kinsella and Phil Alden Robinson wrote in Field of Dreams, ‘If you build it, he will come.’”

Scholarship on Casablanca is sometimes contradictory. And even though the suspects were many, it turns out that the two who wrote most of the lines that make Casablanca effervesce were Julie (short for Julius) and Phil Epstein, identical 32-year-old twins from the Lower East Side of Manhattan who arrived at Warner Bros. via Penn State University, where both ran track and fought on the boxing team.

Philip and Julius Epstein have lunch at Warner Bros., 1941.

The Epsteins, known around the Warner Bros. lot simply as “the boys,” created chaos like lost Marx Brothers, and studio boss Jack Warner despised them. The Epsteins weren’t the first set of writers assigned to the project—they stepped in when the first pair wet the bed trying to figure out how Murray Burnett and Joan Alison’s unproduced stage play Everybody Comes to Rick’s, discovered by story editor Irene “Renie” Lee, could possibly be translated into film when it involved a sadomasochistic sexual affair between a man who had run out on his wife and kids in Paris and a 30-something American woman of easy virtue who were reunited unexpectedly in his Moroccan gin joint.

The suspects were many, but the two who wrote most of the lines that make Casablanca effervesce were Julius and Phil Epstein, identical 32-year-old twins from the Lower East Side of Manhattan.

Of the many tall tales spun around this magical production, one fact is certain: the hundred-page Everybody Comes to Rick’s arrived at Warner Bros. on December 8, 1941, the day after Pearl Harbor had been bombed, and the day F.D.R. declared war on Japan. Lee sensed at once that this narrative, set in Free French Morocco with its heavy Axis influence, could be dynamite, and it was she who cajoled studio executive producer Hal B. Wallis to buy the property for $20,000 and then, with the year’s production schedule already set, to move the new project to the front of the line.

Irene Lee, whose contribution to Casablanca was largely forgotten, in 1940.

The similarities between Lee and her later-generation counterpart, Albert S. Ruddy—the producer depicted in Paramount’s recent The Offer, who begged, borrowed, and stole his way to see The Godfather, “my picture,” as he called it, brought to the screen—are striking. Casablanca was Lee’s picture, Lee’s baby, and she rode herd on it through the pre-production process, participating in story sessions as the script took shape and casting sessions as the players joined Wallis’s merry band, one by one.

Neither Lee nor Wallis thought the Epstein brothers a natural fit for this screenplay—the boys had written successful comedies, and their latest job had been adapting The Man Who Came to Dinner for the screen—but from the day it was assigned to them, the boys relished the challenge. They lived Casablanca day and night, for months, and came up with two-thirds of a good picture in a script draft that already contained their best lines.

But Wallis could see the boys were too smug, too glib, given the messages that needed to be conveyed to the audiences on the home front in the first and darkest days of the war. From Pearl Harbor on, the United States was losing. Nobody knew how bad it might get, or if Japanese planes would be bombing Los Angeles or Germans would march through New York. The American psyche had been shattered in those early days, and Hollywood bosses knew they needed to strengthen backbones in the audience.

The Epstein boys were too smug, too glib, given the messages that needed to be conveyed to the audiences on the home front in the first and darkest days of the war. From Pearl Harbor on, the United States was losing.

Enter Warner contract writer Howard Koch, a left-leaning idealist who specialized in bringing social issues and geopolitics into hits such as Errol Flynn’s The Sea Hawk and Bette Davis’s The Letter. Koch had gained notoriety by writing the Orson Welles radio play War of the Worlds in 1938, a production that sounded so real that many people went into a panic thinking Martians really had invaded. Koch now brought that talent to Casablanca.

Amid all the information on the development of Casablanca, no single piece of evidence says why Hal Wallis found this picture so vital to his personal résumé and to the roster of pictures under his control, but it’s clear he pushed all chips to the center of the table on it, with studio boss Jack Warner at times doubting the sanity of the move.

The usual practice was to save money by casting contract players in supporting roles, which is why you see Allen Jenkins, George Tobias, and Alan Hale in picture after picture. Wallis didn’t use any of them. Instead, egged on by Hungarian-born director Michael Curtiz, Wallis cast Europeans to surround Bogart in every key role.

Rains, Henreid, Bogart, and Bergman in a publicity still for the film.

Nearly everyone you see in the foreground and background had fled for their lives from Hitler’s reign of terror—and all had friends and family who perished. Austrian Paul Henreid was a marked man for refusing to join the Nazi Party. Conrad Veidt had escaped his native Berlin with his Jewish wife. Peter Lorre had experienced a close call departing the Continent, as had Marcel Dalio, who played the croupier, and his real-life bride, Madeleine LeBeau, who played Rick’s jilted girlfriend. Wallis and Curtiz consciously chose European Jews for all the refugee patrons of Rick’s, so that when they stand up to the Germans and sing “The Marseillaise” and tears flow, they really mean it.

Nearly everyone you see in the foreground and background of Casablanca had fled for their lives from Hitler’s reign of terror.

In perhaps Wallis’s biggest gamble of all, he instructed his writers to stick with a Black man as Rick’s best friend, as it had been written in the stage play. Up to 1942, Black actors were bellhops or butlers or porters or maids and used mainly for comic relief. To show a Black man as equal to the hero meant certain walkouts among patrons in the American South. Regional exhibitors might not book Casablanca at all.

Dooley Wilson and Bogart in a scene from the film.

Wallis said to hell with playing it safe and cast an actor new to Hollywood, Dooley Wilson, in the part. Years would pass before anyone else in Hollywood showed such guts as Wallis and his writers had.

It turns out that bit about shooting most of the movie without knowing the ending is true. The Epsteins and Koch just couldn’t nail the love story, but part of the solution involved making the Lois Meredith character—the American woman who had wrecked Rick’s life in Paris—into a European. Lois became Ilsa, and the part stopped being tailored for Ann Sheridan or Mary Astor in favor of Sweden’s Ingrid Bergman.

But Lee and her writers couldn’t make sense of showing why Ilsa would leave Rick after they had found their love and common ground in Casablanca, so yet another writer came aboard to sort out the mess. Casey Robinson specialized in Warner Bros. hit romances, and it was Robinson who made the love story work. The four writers, plus Wallis and Lee, huddled in the studio’s Administration Building and hammered out the final Casablanca Airport sequence, knowing it had to be shot the next day.

Sheet music for the film’s timeless song.

Imagine you’re Bogart, Bergman, and Henreid and a new version of the final sequence arrives at your door at nine at night for shooting at seven the next July morning during one of the greatest heat waves in Los Angeles history.

Part of the solution for the love story involved making the Lois Meredith character into a European. Lois became Ilsa, and the part stopped being tailored for Ann Sheridan or Mary Astor in favor of Sweden’s Ingrid Bergman.

By noon that day, Bogart had snapped and stormed off the set under the weight of those long, just-written speeches he hadn’t had time to memorize. You know the ones: “What I’ve got to do, you can’t be any part of,” and so on. Speeches to Bergman that went on and on and on, with Bogart looking directly into her eyes and not at cue cards.

The movie left to history is all the more remarkable because of that last-minute collaborative ending, cooked up by two executives and four writers in the bottom of the ninth with two strikes and two outs. Then Curtiz and his actors took it from there and made it work.

Bogart and Bergman in a scene from the film.

And that last line, as Bogart and Claude Rains walk off into the fog? “You know, Louis—I think this is the beginning of a beautiful friendship,” says Bogart. It wasn’t in the script. Wallis watched the picture after it had been cut together, after the creative team had disbanded and the sets had been struck, and thought the ending needed a little somethin’ to show that Rick would persevere without Ilsa because, indeed, the problems of three little people didn’t amount to a hill of beans in a world threatened by the Axis powers. Wallis dragged Bogart back to the studio from vacation on his boat to record the audio of that line. And they staged the walk-off with Rains after production had been finished for two weeks.

Eighteen months later, the Epsteins and Koch won an Academy Award for their screenplay. Robinson, who had been so instrumental in making the love story work, followed a practice of not sharing credit for screenplays, so he didn’t win a statuette, although he had certainly earned one.

And Irene Lee, who had championed her picture throughout? True to the times and to the status of women executives in Hollywood, she got nothing. Zero credit. She asked Hal Wallis if she didn’t deserve at least a bonus, and he told her she was just doing her job. So thoroughly had Hollywood overlooked Lee’s role in Casablanca that if she hadn’t given away $100 million in 1990s New York City as philanthropist Irene Diamond (she married real-estate developer and philanthropist Aaron Diamond), the story would never have come to light.

Robert Matzen is the author of several nonfiction books. His first novel, Season of the Gods, on the making of Casablanca, will be published on October 3 by GoodKnight Books