Quite a double-act: Lillian Hellman and Dashiell Hammett's stormy partnership equals any onstage drama

When Mary McCarthy said of Lillian Hellman, "every word she says is a lie, including 'and' and 'the'", a certain attitude was fostered. Not only to the celebrated playwright's experiences in war-torn Spain during the 1930s or before the House Un-American Activities Committee during the 1950s, but also to her personal life. Hellmann, this attitude said, was a myth-maker of the worst kind. She couldn't be trusted to tell the truth, not even about those she loved. So what if she wrote in her memoirs that crime writer Dashiell Hammett, with whom she lived on-and-off for 30 years, was the most important person in her life? "Did anyone ever see them together?" queried Gore Vidal.

Writers make myths out of people's lives, especially their own. And when writers become embroiled with other writers, the opportunity increases ten-fold. It was to Hammett, the pulp magazine writer turned detective novelist, that she always owed a debt, Hellman insisted. The completion of her first play, The Children's Hour, in 1934, just four years after they met at a Hollywood party, was all thanks to "help from Hammett." She "worked better if Hammett was in the room." Yet Hellman's words about this crucial relationship have been doubted too. Perhaps it didn't help that she wrote in her 1969 memoir, An Unfinished Woman, "what a word is truth. Slippery, tricky, unreliable. I tried in these books to tell the truth...I see now, in re-reading, that I kept much from myself, not always, but sometimes."

Lillian Hellman was married to a writer, Arthur Kober, when they wound up in Hollywood in 1930. Kober had a script-writing job and Hellman was a script-reader. She was 25, bored in her five-year marriage and had writing ambitions. When she met Hammett at a party, he was 36 and famous, the bestselling author of Red Harvest and The Maltese Falcon. Different accounts of their first meeting don't help Hellman's case for truth-telling, but there is a nastier undercurrent to those who doubted Hellman's version of the subsequent relationship.

Hammett was extremely handsome and rich, thanks to his books. Hellman was never a pretty girl, and had a forthright manner that scared people. Some doubted Hammett's interest in her: why should such a successful writer take up with an unattractive nobody?

But Hammett had spotted something in Hellman, and his own bright star was on the wane. After 1930, he wrote only one major novel, The Thin Man, a semi-autobiographical account of his relationship with Hellman. His depressive moods, his reliance on alcohol and his promiscuous ways (he was felled by gonorrhoea several times) damaged his ability to write. The fire had gone out of his own literary ambitions, but that didn't mean he couldn't take an interest in another's writing. After his death, Hellman wrote, "in time I came to learn that he was good to all writers who needed help, and that the generosity had less to do with the writer than to do with the writing and the pains of writing."

Hellman's experience of the "pains of writing" were always assuaged by Hammett's presence, his advice and criticism, even though theirs was the stormiest of liaisons. At one party, during an argument, he punched her on the jaw. On the opening night in New York of The Children's Hour, a play that Hammett had suggested to Hellman after reading about a 19th-century court case where two headmistresses of a girls' school in Scotland were accused by a pupil of having a lesbian affair, she called him in LA to tell him how well it had gone. A woman answered, saying that she was his secretary. When Hellman realised it was 3am, and Hammett had no secretary, she jumped on a plane and trashed his house.

In response to his affairs, she would have affairs, desperate to make him jealous. That they infuriated each other often was clear: on one occasion, she found him grinding a lit cigarette stub into his cheek. "I said, 'What are you doing?' 'Keeping myself from doing it to you,' he said."

But always there was the writing. Hellman's instant success with The Children's Hour meant she wasn't afraid of controversy (the play was initially banned in the UK) and its follow-up, Days To Come, was an angry, political work about factory strikes. It failed, however, and many have blamed Hammett's influence: the Communist sympathiser who had once worked as a Pinkerton's agent was politically active and encouraged Hellman to be so. But The Little Foxes, based on families she knew in her home town of New Orleans, was another smash hit. It was the one, she maintained, "that was most dependent on [Hammett]. We were living in the same house, he was not doing any work of his own but after his death, when much became clear to me that had not been before, I knew that he was working so hard for me because Days To Come had scared me and scared him for my future."

In her memoirs, Hellman gives occasionally disturbing glimpses of their writing life. Hammett taught her to be economical with her style, to be direct, and was unstinting in his critiques. When she passed him the first draft of The Autumn Garden, he shouted at her, "You started out as a serious writer. That's what I liked, that's what I worked for. I don't know what's happened but tear this up and throw it away. It's worse than bad – it's half good."

Did she like his bullying style? Could she only rate herself in his eyes? Why did she want to maintain this link with a man who beat her, cheated with prostitutes and other men's wives, encouraged her into alcoholism and, finally, berated her writing?

It's a picture that suggests a weak character, a submissiveness in Hellman that does her no credit. Indeed, actors in her plays would comment on how scared they were of her when she came to watch them rehearse because she could be formidable, masculine in her approach. Then Hammett would turn up and she would change, become more vulnerable, "feminine".

But that's to miss what was happening between these two writers, for all the cheating and drinking and fighting. An important exchange was taking place, as Hellman notes in her memoir, begun in their early days together when they booked into a New York hotel and he worked on The Thin Man: "I had known Dash when he was writing short stories, but I had never been around for a long piece of work. Life changed: the drinking stopped, the parties were over. The locking-in time had come and nothing was allowed to disturb it until the book was finished. I had never seen anybody work that way: the care for every word, the pride in the neatness of the typed page itself, the refusal for ten days or two weeks to go out even for a walk for fear something would be lost. It was a good year for me and I learned from it".

And it wasn't all one way. When Hammett was working on the screenplay of Hellman's 1940 play Watch on the Rhine, Hellman wasn't afraid to call him on it. According to one biographer, Hammett's "prodigious intellect" and considerable reading were only getting in the way, leading to turgid, overly reflective scripts. "For once, the roles were reversed: Hellman took the blue pencil to Hammett's disquisitions." Yet she still admired "the way Hammett could articulate human character and politics in movie scenes that were not in her play. 'He's put in one scene that I'd have given anything to have written,' she remarked."

Writers in relationships with one another will put up with a great deal for those rare, magical moments. If the rest of the time is plagued by jealousy and affairs and alcoholic rages, perhaps those moments do take on the status of myth. By 1952, the farm estate, Hardscrabble, that Hellman had bought with the proceeds of her plays and films had to be sold. Both she and Hammett were called to appear before the House Un-American Activities Committee (HUAC), accused of being Communist Party members, and pressurised to name those who were present at political meetings.

Hammett refused to testify and was sent to prison for six months; Hellman testified but refused to name names, and was subsequently blacklisted. Hardscrabble had to be sold, and when Hammett came out of prison, weaker and thinner (he had suffered from tuberculosis as a young man), it was only to spend his last few years ill and in poverty. In 1979, Hellman published her trilogy of memoirs, An Unfinished Woman, Pentimento and Scoundrel Time, and once again won over critics and the public alike.

Until Mary McCarthy denounced her on TV in 1980, with her famous remark. Martha Gellhorn added to the furore, questioning several of Hellman's recollections of her time in Spain. Gellhorn was there along with Hemingway, with whom she was having an affair. Hellman's claim that Hemingway had propositioned her, then changed his mind, might not have helped win her Gellhorn's support.

Lillian Hellman has been accused of invoking Dashiell Hammett's memory in her autobiographies in order to bolster her own reputation. But as one of the few female American playwrights to produce Broadway hit after Broadway hit, which often became hugely successful Hollywood films, she hardly needed to do that. No doubt the truth of their relationship is even murkier than the details she gives out suggest. Perhaps they didn't mean as much to each other as she says they did. But what we have is an account of a literary partnership that existed, and that mattered, to both writers involved. Hellman might never have been the success she was without Hammett, it's true. But that doesn't make her a lesser writer, or a victim of a male lover's often bad behaviour. It shows how important writing was to her. And that was something they both understood.

Lesley McDowell is the author of 'Between the Sheets: the literary liaisons of nine 20th-century women writers' (Duckworth Overlook). 'The Children's Hour' runs at the Comedy Theatre, London, from 22 January to 30 April