John Huston had a Darwinian view of Hollywood. "It's the jungle and it harbours an industry that's one of the biggest in the country," he once said. "A closed-in, frantically inbred, and frantically competitive jungle. And the rulers of the jungle are predatory and fascinating and tough."

Huston (whose The African Queen is being screened in a restored version in Cannes) was intrigued by the utter ruthlessness of the studio system: the fight for power, the way that executives crushed the careers of rivals and the deference that even the most powerful studio bosses had for "the very top rules of the jungle", the money men pulling the purse-strings far away from Hollywood in New York.

Whatever his fascination with Hollywood, Huston couldn't wait to get away. It's hard to think of any other American director of his stature who worked so infrequently in the studios and so often in far-flung locations. The story of the making of The African Queen was outlandish, even by Huston standards. The film has inspired articles, memoirs and even novels. What went on behind the scenes was every bit as colourful as the ripping yarn with Katharine Hepburn and Humphrey Bogart up on the screen.

In early 1950, Huston had embarked on what he was convinced would be his masterpiece, an adaptation of Stephen Crane's American Civil War novel, The Red Badge of Courage. The making of the film is chronicled in Lillian Ross's 1952 book, Picture. As Ross makes clear, the film did not turn out as Huston had hoped. MGM boss Louis B Mayer had been sceptical about its commercial prospects from the outset. Huston had hoped to shoot it in Tennessee, in the Deep South. In the event, he had to shoot his Civil War epic in the San Fernando Valley, with MGM executives breathing down his neck. It tanked.

Embarking on The African Queen, even before The Red Badge of Courage was complete, was Huston's way of escape. He chose locations as far away as he could from the Hollywood jungle... deep in the Belgian Congo. Instead of ruthless MGM executives, his antagonists now were crocodiles, ants, scorpions and black mambas. Delays in production were caused by bouts of amoebic dysentery and malaria, not by the shortcomings of the costume department. Huston took his guns in the hope he might be able to bag an elephant in breaks between shooting.

The Red Badge of Courage was a Hollywood studio movie. The African Queen was financed in a different way. Huston's business partner Sam Spiegel (with whom he had founded Horizon Pictures in 1947 and who was even more of a gambler than him) had somehow talked a sound-equipment company into advancing him $50,000 to buy The African Queen rights from Warner Bros. Spiegel couldn't afford actually to make the film, which was in the end largely financed by London-based production outfit Romulus Films, run by John and James Woolf. In today's lingo, this was a UK-financed indie movie.

Top 10 greatest movies of all time Show all 9 1 /9 Top 10 greatest movies of all time Top 10 greatest movies of all time The Shawshank Redemption, 1994 Tim Robbins and Morgan Freeman play two imprisoned men who form a deep bond PA Top 10 greatest movies of all time Pulp Fiction, 1994 John Travolta as Vincent Vega and Samuel L Jackson as Jules Winnfield in Quentin Tarantino’s 1994 Palme d’Or winner Top 10 greatest movies of all time The Godfather, 1972 Marlon Brando as Don Vito Corleone in the triple Oscar-winning film EPA Top 10 greatest movies of all time The Dark Knight, 2008 Heath Ledger as the Joker, in what would be one of his last ever roles Top 10 greatest movies of all time Star Wars Episode IV: A New Hope, 1977 The original Star Wars trio of Harrison Ford, Carrie Fisher and Mark Hamill AP Top 10 greatest movies of all time The Lord of the Rings: The Fellowship of the Ring, 2001 The first installment in Peter Jackson's trilogy, based on the novels by JRR Tolkein New Line Cinema/AP Top 10 greatest movies of all time Jaws, 1975 Steven Spielberg's quintessential monster movie Rex Features Top 10 greatest movies of all time Raiders of the Lost Ark, 1981 Harrison Ford stars as the world’s best known archaeologist, taking on Nazis, booby traps and ancient demons - and rescuing some distressed damsels along the way AP Top 10 greatest movies of all time Inception, 2010 The sci-fi thriller, starring Leonardo DiCaprio, sees thieves invading people's dreams

Other British producers felt that the Woolfs were crazy to become involved with chancers like Spiegel and Huston. As John Woolf later told historian Brian McFarlane, Alexander Korda warned him against a film "about two old people going up and down a river in Africa, with a director whose last film was a disaster.' Nonetheless, Woolf had full confidence in Huston, if not altogether in Spiegel.

Huston was a paradox: a maverick perfectionist who was also reliable, pragmatic and quick. The volatile American director held a special fascination for writers and journalists. There was something about him that was so extreme and so contrary that they felt compelled to follow him.

One of the many mesmerised by Huston was journalist and poet James Agee, who wrote a lengthy profile of the film-maker for Life magazine in the autumn of 1950. This read more like a Jack London story than a conventional journalistic portrait. Huston was "an awfully nice guy to get drunk with", someone who had meandered into writing movie scripts only because he wanted to prove to a girl that he was "more than a likeable bum". As a kid, he had a mystery illness which kept him confined to a sanatorium. While the doctors fussed over his health, he reacted by putting himself in jeopardy: going for reckless midnight swims down fast-flowing waterfalls. (He got the same kicks from these jaunts as Hepburn's missionary does from hurtling down white water rapids in The African Queen). Huston was a horseman, a boxer, a gambler a former Mexican cavalry officer, an artist and an explorer. "Incapable of yes-ing, apple-polishing or boot-licking, he instantly catches fire in resistance to authority," Agee wrote of him.

Huston liked Agee's profile and hired him to co-write the script of The African Queen. This didn't prove beneficial for Agee's health. Huston played three sets of tennis with him every morning before breakfast. Partly as a result of such strenuous exercise on the courts, Agee, a heavy drinker and smoker, suffered a heart attack that prevented him from travelling to Africa. Huston took novelist Peter Viertel instead. Viertel was later to write a novel, White Hunter, Black Heart (1953), itself made into a movie by Clint Eastwood, inspired by the escapades in Africa. The film-maker based on Huston wasn't exactly sympathetic. John Wilson, as he was called, is described as a "violent man... a spoiler with a mania for destruction and disaster". He is portrayed as more interested in hunting than in preparing for his new film.

Seen today, The African Queen seems a very perverse endeavour. It's a lark – a comedic adventure yarn about white folk in Africa during the early days of the First World War. A prim Methodist missionary (Katharine Hepburn) and a grizzled boat-captain (Humphrey Bogart) set off down-river together to take on the Germans. The film may have been adapted from a CS Forester novel but it was shot in precisely the locations that Marlowe describes in Joseph Conrad's Heart of Darkness, "where the merry dance of death goes on in a still and earthy atmosphere as of an overheated catacomb." Abetted by Jack Cardiff's iridescent Technicolor cinematography, Huston turned the savage landscape of Conrad into the backcloth for an upbeat adventure. You could imagine the same film made by Werner Herzog or Francis Ford Coppola as a story of a mad and desperate quest, perhaps with Klaus Kinski at his most demented as the ship captain. Huston, though, keeps matters light and playful, even when the leeches are devouring Bogart or a German noose is about to be strung around his neck. The absurdly far-fetched and upbeat ending, different from that in Forester's novel, reinforces the sense that this is one long shaggy-dog story

The accounts that the actors and film-makers gave of their experiences in Africa make the production sound like a version of I'm A Celebrity...Get Me Out Of Here! The only members of the crew who didn't come down with dysentery were Huston and Bogart, because they were drinking whisky rather than the water, which turned out to be the source of the infection. The Daily Express journalist who went on location with the cast and crew relished describing the columns of soldier ants that climbed Hepburn's legs and pestered Bogart and his wife, Lauren Bacall. His second dispatch from the African front line had the headline "Hepburn goes down with the jungle jeebies".

Huston relished the incongruity of Hepburn's prim missionary in her frilly blouse ("a crazy, psalm-singing, silly old maid") adrift in a world of humidity, disease and decay. He told the actress to smile like Eleanor Roosevelt, a tip that helped the actress convey resilience, cheerfulness and a very comic hauteur. "We all took John's cue and realised that we had to work with the bugs and snakes and muck and bad weather, not around them all. To have fought against all the elements would have been futile," Hepburn later told A Scott Berg.

Much of the enduring pleasure of The African Queen lies in the way Hepburn and Bogart manage to retain their familiar poise and personae in spite of the extraordinary circumstances in which they find themselves. Hepburn's face may be drenched with sweat, we may know from subsequent accounts that she was vomiting into a bucket between shots, but she is still as haughty and strong-willed as she was in The Philadelphia Story. Bogart (who won an Oscar) isn't so different from those tough, wisecracking figures he played in gangster movies.

Huston isn't much interested in Africa other than as an exotic location for a ripping yarn. Questions about colonialism, race and national identity hardly enter into his mind. He pays more attention to the crocodiles and hippos than he does to the local people. The inner workings of the engine of the African Queen (the boat that carries Hepburn and Bogart down river) is more important to the plot than the plight of the villagers whose huts are burned by the Germans at the start of the movie. Even so, The African Queen is still one of the most celebrated and best remembered films ever made in Africa, and the circumstances behind its production have long since passed into myth.