WHEN DASHIELL Hammett's third and best novel, "The Maltese Falcon," appeared in 1930, Warner Bros. paid his publisher, Knopf, $8,500 for all movie rights. "The Maltese Falcon" was destined for strange metamorphoses. This had been Hammett's first effort to break away from the routine pursuits of the anonymous Continental (Pinker-ton) operative. His new hero, Sam Spade, was in business for himself; he was perfectly willing to take criminals as his clients; he was having an affair with his partner's wife; he liked to believe that he belonged to nobody.

Hammett later claimed that his hero "had no original . . . . He is a dream man in the sense that he is what most of the detectives I worked with would like to have been . . . a hard and shifty fellow, able to take care of himself in any situation, able to get the best of anybody." If Sam Spade was a dream man, though, his identity was hardly accidental; everyone who knew Hammett in his detective days knew him not by his middle name, Dashiell, but by his first name, Sam.

"The Maltese Falcon" was also Hammett's first attempt to break away from the mindless violence of the "action" stories he had published in Black Mask magazine, to create a drama of primarily psychological tension.

The climactic scene occurred when Spade and the beautiful Brigid O'Shaughnessy and the bloated Casper Gutman and the twittering Joel Cairo all sat confined in one room and tried to outwit each other to get possession of the jeweled statue of the Maltese falcon. It was another variation on Hammett's favorite situation, the detective attempting to provoke the criminals into fighting and betraying each other, though the actual violence all occurred offstage. Hammett suggested richer possibilities when he portrayed Spade trying to persuade Gutman to pin a murder charge on his own bodyguard, Wilmer. "But that's ridiculous," Gutman protested. "I feel towards Wilmer just exactly as if he were my own son. I really do. But if I even for a moment thought of doing what you propose . . . . "

In a Hollywood that paid people a weekly wage to rewrite "A Farewell to Arms" and "Miss Lonelyhearts," that hired Salka Viertel to "adapt" "Anna Karenina," nothing, obviously, could be left alone. Warners assigned "The Maltese Falcon" not to Hammett but to three of its regular employes, Maude Fulton, Lucien Hubbard and Brown Holmes.

And since it was unthinkable for the hero to denounce the heroine as a murderess and then turn her over to the police ("I'll be sorry as hell -- I'll have some rotten nights -- but that'll pass," Spade had said to Brigid), the trio of rewriters ended by suggesting that Spade would win a fine new job in the district attorney's office, that Brigid would get out of prison soon and that she and Spade would finally be reunited. Warners assigned the role of Spade to Ricardo Cortez (ne

Jacob Krantz), who was trying to become the successor to Rudolph Valentino and played several of his scenes with Brigid in a silk lounging robe. Brigid was Bebe Daniels, who was known mainly as a comedienne. The whole thing was renamed "Woman of the World," then "Dangerous Female," and it inevitably failed.

In 1936, Warners tried again. One of the three rewriters, Brown Holmes, was assigned once again to claw at the bones of Hammett's novel. This time, Spade turned into a lawyer named Ted Shayne. He ended by marrying his secretary. Casper Gutman became a woman. The black figure of the falcon turned into a jeweled French horn. This version, too, received several new titles: "Men on Her Mind," then "Hard Luck Dame," then finally, and most ludicrous of all, "Satan Met a Lady." Spade/Shayne was played by Warren Williams, and Brigid O'Shaughnessy (renamed Valerie Purvis) by Bette Davis, who called this farrago "one of the worst turkeys I ever made."

And in 1941, Warners tried yet again. This time, though, as so often happened with Hollywood's great successes, there occurred a series of happy accidents. The driving force behind them was John Huston. Having been a semiprofessional boxer, a Mexican cavalryman, a painter of sorts, and finally a screenwriter of considerable promise ("Juarez," "Dr. Ehrlich's Magic Bullet," "High Sierra"), Huston had reached the age of 35 and wanted to strike toward the center of Hollywood power. His agent, Paul Kohner, had artfully inserted a clause into Houston's screenwriting contract that committed Warners to letting him choose one picture to direct himself.

"I selected Dashiel Hammett's 'The Maltese Falcon,' " Huston laconically recalled in his memoirs. "It had been filmed twice before, but never successfully. Blanke and Wallis {his producers} were surprised at my wanting to remake a two-time failure, but the fact was the Falcon had never really been put on screen."

Allen Rivkin's recollection is more vivid: "Johnny . . . asked me to work with him as screenwriter on a new version of 'Falcon,' telling me, 'Christ, Al, the book has never been done right.' "

The next accident involved the casting of Warner's biggest gangster star, George Raft, as Sam Spade. Raft had grown up in the slums of New York's Ninth Avenue, and he remained a lifelong friend of various Hell's Kitchen gangsters, so much so that these professional gunmen imitated the styles that Raft created for them. The white tie on black shirt was a Raft trademark, as was the nonchalant flipping of a coin (actually suggested by Howard Hawks when he hired Raft to co-star in "Scarface"). Al Capone himself asked Raft why ke kept flipping the coin, and Raft casually said, "Just a little theatrical touch."

But for all his seeming authority, Raft not only had no talent as an actor but had no sense of his own public identity. He refused to play the gangster in Sidney Kingsley's "Dead End" (1937) unless he was allowed to warn the Dead End kids that crime did not pay. So the part went to a young actor named Humphrey Bogart.

Raft also refused to play the fugitive hero in Huston's latest script, "High Sierra" (1941), because the fugitive got shot at the end, and Raft didn't want to play men who got shot. He had other objections as well. "Too many words, Irving," he said to an intermediary. "Too many words."

Warners turned to some of its other eminent gangsters. Paul Muni, who had been Raft's boss in "Scarface," rejected the role because Raft had rejected it; so did Edward G. Robinson; so did John Garfield. Bogart said only, "Where the hell's the script and when do I start?" "High Sierra" was Bogart's first starring role.

Now Raft didn't want to play Sam Spade either. He said that "The Maltese Falcon" was "not an important picture." His chief reason seems to have been that Huston was a novice director, but his agent, Myron Selznick, was also skeptical, and Raft's contract said he didn't have to perform in any remakes.

"I didn't know much, so I listened to guys who were supposed to know something," Raft later explained. "It was a low-budget picture."

Jack Warner broke the news to Huston: "Guess you'll have to settle for Bogie." There were other complications of the same sort. Huston wanted Geraldine Fitzgerald to play Brigid O'Shaughnessy, but Warners insisted on Mary Astor.

Sidney Greenstreet as Gutman was one of Huston's inspirations. At a waddling 285 pounds and 61 years of age, Greenstreet had never made a movie, but Huston had seen him playing butlers on Broadway and insisted on signing him up. Peter Lorre, a witty and cultivated refugee from Berlin, had become an exemplar of loathsome perversions when Fritz Lang cast him as the compulsive child-murderer in "M," so he brought a cringing malevolence to the role of Joel Cairo. And for good luck, Walter Huston, the young director's famous father, agreed to play the bit part of the dying ship captain who staggered into Spade's office with the crudely wrapped package containing the legendary falcon.

It was, in short, a spectacularly talented cast. And then there was Huston himself. In fact, much of the success of the film can be credited, if only by default, to Huston. Just as he relied heavily on Hammett's original novel for his screenplay, he relied heavily on Arthur Edeson's quasi-documentary photography for the bleak, dark, claustrophobic quality that came to be known as film noir. Some experts ascribe the flowering of film noir during the early 1940s to some of the German refugees -- Lang, Wilder, Preminger, Siodmak -- who brought with them memories of the style that had been developed at the UFA studios in Berlin.

Others suggest that it was simply a matter of economics. At Warners, a studio so frugal that some of its employes called it "San Quentin," shooting a film in moody darkness and rain tended to disguise the cheapness of the sets. These elements all suited the young Huston on his first assignment, for, as Charles Higham has written, "the film's most striking feature is its insolent casualness, its deliberate lack of flourish."

Huston also had the wit to sense in Bogart an actor on the verge of triumph and to focus on him in scene after scene. For if the script was a faithful translation of Hammett's novel, it was Bogart who made the movie not only different from the novel but substantially better. When we imagine Spade, half a century after Hammett created him, we don't see anything like the figure that Hammett described: "Samuel Spade's jaw was long and bony, his chin a jutting V under the more flexible V of his mouth . . . . His yellow-gray eyes were horizontal . . . . He looked rather pleasantly like a blond Satan." Nor do we hear the voice that might have come from such a "Satan." We see, hear, recognize, and know the somewhat wrinkled and battered figure of Humphrey Bogart. "The Maltese Falcon" was the movie in which he created the persona that not only made him famous for the rest of his life but gradually became his own permanent identity.

Bogart had not been born for any such fate. His father, Dr. Belmont DeForest Bogart, was a prosperous physician in New York; his mother, Maude Humphrey, was a suffragette, a magazine illustrator who prided herself on having studied in Paris with Whistler. Humphrey, their firstborn, arrived on Christmas Day of 1899. ("I never had a birthday of my own to celebrate," he later complained.) There were two younger sisters, one who suffered a mental breakdown and another who died of peritonitis.

Young Humphrey went to Trinity, a starchy Episcopalian school on New York's Upper West Side, then to Andover, which was supposed to prepare him for Yale and a life of upper-middle-class respectability. He flunked five of seven subjects, however: Bible studies, French, English, chemistry, and geometry. The headmaster wrote sternly to Dr. Bogart that he was "forced to advise you . . . that it becomes necessary for us to require his withdrawal from the school."

Dr. Bogart was shocked. It was 1918, however, so Humphrey enlisted in the Navy, served a few months on a troop transport, then emerged into a New York where, for a handsome young man, nothing was very serious and anything was possible. A school friend named Bill Brady had a father who dabbled in theatrical productions and agreed to hire Bogart as an office boy. Office boys traditionally became understudies, and understudies eventually won bit parts. The morning after Humphrey's Broadway debut, his mother woke him up to read him Alexander Woolcott's review: "The young man . . . was what might mercifully be described as indadequate."

Even then, though, Bogart had admirers. "My first impression of Humphrey Bogart," Louise Brooks wrote of meeting him in 1924, "was of a slim boy with charming manners, who was unusually quiet for an actor. His handsome face was made extraordinary by a most beautiful mouth. It was very full, rosy, and perfectly modeled . . . . "

Such views enabled Bogart to keep finding roles throughout the 1920s. It has been reported, but never proved, that he appeared on stage in a blue blazer and actually said, "Tennis, anyone?" He was beginning, though, to acquire a label as an aging juvenile. Then he got a chance to audition for a wildly unlikely role, the fugitive gangster in Robert Sherwood's "The Petrified Forest." Leslie Howard, who was not only the star but the coproducer, quickly decided that Bogart would be perfect as the psychopathic Duke Mantee, and when they opened in 1935, the theater critics warmly endorsed Howard's judgment. Warners bought the play, hired Howard to star in it, took an option on Bogart, and then assigned the part of Duke Mantee to Edward G. Robinson. Bogart unhappily telegraphed this news to Howard in Scotland. Howard telegraphed Warners that he would not play the hero unless Bogart played the gangster. Warners gave in and summoned the young man to Hollywood.

So Humphery Bogart, who had failed in his destined course toward Yale, became a gangster. "Over the years," Louise Brooks recalled, "Bogey practiced all kinds of lip gymnastic, accompanied by nasal tones, snarls, lisps and slurs." He snarled and lisped through a whole string of superficial roles: "San Quentin," "Dead End," "The Roaring Twenties." He got $650 a week, and toward the end of most movies he got shot, snarling.

Bogart was having terrible troubles during these years with his third wife, Mayo Methot. She drank heavily and, as she drank, she first began accusing him of flirtation, vanity and various other sins, and then she began smashing things. "I like a jealous wife . . . . " Bogart told an interviewer. "And I like a good fight. So does Mayo. We have some first-rate battles." Warring husbands and wives often give each other cues, and one of Mayo's most ominous signals was the song, "Embraceable You." She was singing it one night when Bogart returned home from a drying-out session at the Finlandia Baths on Sunset Boulevard, and that was her only warning before she lunged at him with a butcher knife. Bogart ducked and ran, but she stabbed him in the back. He fell to the floor and passed out, woke to hear someone calling for a doctor, passed out again, woke to hear a doctor say, "It's not so bad. Only the tip went in. He's a lucky man."

Bogart often spent all night drinking, then appeared at the studio fully ready to work. His portrayal of Sam Spade embodied all that. It was the portrait of a man had been up all night, a man with both a hangover and a determination to get a day's work done, a man whose wife had stabbed him in the back and might do so again. Yet Bogart's Spade had another characteristic lacking in Hammett's original creation, and that was humor. When Hammett's Spade roughed up the young gunman, Wilmer, he was just being tough. When Bogart roughed up Elisha Cook, he was being not only tough but perilously funny, mocking and humiliating a man who yearned to kill him. It was a great scene.

Humor combined with a kind of willed toughness made Bogart immensely sympathetic, and real in a way that his gangsters had never been. It was, of course, a reality based on layers of deception. "Don't be too sure I'm as crooked as I'm supposed to be," Spade told Brigid toward the end. So Humphery Bogart of Andover, who had gained a temporary success playing gangsters, achieved his huge triumph and spent the rest of his life playing pseudo-gangsters, enforcers of the higher law of their own creation.

Up to the very end, the authorities at Warners couldn't seem to understand that "The Maltese Falcon" was a marvelous title. Having chanaged it to "Dangerous Female" and "Men on Her Mind" and "Satan Met a Lady," and having failed every time, they now wanted, even at the last preview, to change it to "The Gent from Frisco." It was apparently Hal Wallis, the production chief, who persuaded all the nervous improvers to desist. So "The Maltese Falcon," finally, was a smashing success.

And what financial rewards did Dashiell Hammett, the creator, derive from this success? Nothing whatever, for when Warner Brothers had bought the movie rights to his novel 11 years earlier for $8,500, the studio had bought all movie rights forevermore. A few years later, in fact, when Hammett sold ABC Radio the right to produce a series called "The Adventures of Sam Spade," Warners filed suit, claiming in the spring of 1948 that the studio owned the named of Sam Spade as well as related "scenes, language, story, dialogue, plot, characters, and other materials" of "The Maltese Falcon."

It took three years of judgments and appeals before Hammett won the right to his own hero, and by that time the whole show had been forced off the airwaves on the ground that Hammett was a "subversive."

Otto Friedrich is the author of "City of Nets: A Portrait of Hollywood in the 1940s," from which this article is excerpted.