Philip Kaufman's film about Ernest Hemingway and journalist Martha Gellhorn is as gloriously messy as the couple's swashbuckling relationship and marriage itself.

One of Kaufman's most naked and overtly passionate films, "Hemingway & Gellhorn," airing Monday on HBO, is over the top in places, grand, sexy and probably too long. In the end, we are left feeling that while we'd probably never want to live next door to this compellingly noisy pair, they'd make swell company for a rum-soaked night on the town.

Filmed entirely in the Bay Area, "Hemingway" focuses on a pivotal period in the author's life. He'd already achieved acclaim for his novels "The Sun Also Rises" and "A Farewell to Arms," but perhaps more to the point of Kaufman's film, he had already crafted an outsized public persona for himself as the he-man of American letters.

Still ahead of him were the late-life parable, "The Old Man and the Sea," the Nobel Prize for literature in 1954 and the fatal shotgun blast in 1961 that, for a time, was said to have been an accident. The Hemingway image factory was still working, postmortem.

He met journalist Martha Gellhorn in Key West, Fla., in 1936, when he was still married to his second wife, Pauline, a devout Catholic who foolishly hoped she could compete with Hemingway's globe-trotting ambition. Eventually winning a divorce from Pauline, Hemingway married Gellhorn in 1940, the year he finished his masterpiece, "For Whom the Bell Tolls."

By the time they got married, Kaufman's film tells us, their relationship was already beginning to lose steam, because Hemingway and Gellhorn really thrived as a couple only when they were covering the Spanish Civil War. In a way, World War II could have saved the marriage by giving the couple something else to cover together, but by then, the damage of the years of fighting, drinking and matching egos had been done.

All of them are great, but the focus and the story belong to Clive Owen's Hemingway and Nicole Kidman's Gellhorn. Their meeting at Key West's famous Sloppy Joe's bar (which looks as roomy as the bar does today, but nothing like the original Sloppy Joe's, a dim little joint called Captain Tony's, off Key West's main drag of Duval Street) is sexually charged, but more important, it's an instantaneous competition of egos.

In the early years of their relationship, Hemingway is attracted by Gellhorn's spirited independence. But at the time of their meeting, she was still relatively green in some areas of her profession, not to mention naively altruistic about the nobility of just causes in wartime.

Hemingway was given to throwing his weight around and making grand, albeit minimalistic, pronouncements about life. His letters are filled with opinion about how other people should live ("Never confuse movement with action," he told Marlene Dietrich. Another commandment, "The best way to find out if you can trust somebody is to trust them," is quoted in the film).

Almost from the moment they meet, Hemingway sees Gellhorn as a protege, the sexy new student in class played against his wise professor. She's eager to learn and ambitious enough to listen for a while. That only adds to their bubbling sexual chemistry, which is consummated in the midst of a bomb attack on the Hotel Florida in Spain (an empty train station in Oakland, repurposed and relocated for the film).

Although Gellhorn's character travels further during the course of the film than Hemingway's, Owen has a big challenge in trying to humanize the author. Hemingway is portrayed as a swaggering, self-righteous, bullying loudmouth, with only occasional hints of whatever demons may have driven him internally. It doesn't help that every time the mustachioed Owen grins with a cigar in his teeth, he looks like Groucho Marx. Owen makes the character interesting but never quite fills in the blanks.

Kidman didn't have an enormous public persona in Martha Gellhorn to work with (or against), but she is both luminous and masterful as she takes Martha from starry-eyed optimism to war- and Hemingway-hardened cynicism. You can't take your eyes off her, not because she's beautiful but because her performance is so compellingly dominant.

The entire film is structured as one big flashback as Gellhorn is interviewed, late in life, by a David Frost-like character. At the start of the movie, the elderly Gellhorn says she never liked sex, but felt it was expected by the men she was with. It's only at the end of the film, as she tells the interviewer she won't allow herself to become a "footnote" in the life of a man who'd killed himself many years before, that we understand how much she's adopted a tough, protective veneer much as Hemingway had done.

Now, we have a better sense of what she was protecting, as evidenced by the exuberant love scenes between Kidman and Owen. If Gellhorn didn't like sex, we can't help wondering what she'd be like in bed if she had. But that memory is what Gellhorn, in old age, keeps locked away, not only from her interviewer but perhaps from herself.

What the film doesn't include is the fact that she, too, committed suicide - by overdosing on drugs when her life had been ravaged by illness and blindness at 89. Like her mentor, she had to be in control, even at the ultimate moment.

As in past films, Kaufman blends archival footage into the action of "Hemingway & Gellhorn," which of course enhances the authenticity of the film's depiction of its lead characters in the midst of the Spanish Civil War. Kaufman pulls out all the stops in depicting the war - at times, almost seeming to have more interest in the conflict than in Hemingway and Gellhorn.

But, in fact, we're seeing the war the way he wants us to think his characters saw it. It fascinated them, empowered them, and perhaps distracted them from the realities of what their relationship was and what it could never be.

For a while, two larger-than-life people found and loved each other and it was a good, rich time. Without a war to bind them together, as Gellhorn says, they ended up making their own war between themselves. They fought as hard as they'd loved. and you can't help feeling that they probably knew it was too intense to last forever.

Kaufman's film, despite some flaws, captures the intensity of their story and pulls us in with the irresistible force of a great, doomed love story.

To read Pamela Feinsilber's three-part series on the making of "Hemingway & Gellhorn," go to sfgate.com.