Sir David Lean is rightly celebrated as one of British cinema's greatest ever directors, the creator of, among others, Lawrence of Arabia, Great Expectations and The Bridge on the River Kwai. And yet little is known of his final project, Nostromo, which proved to be one of the biggest epics never to see the light of day and which caused the downfall of a tormented genius.

Based on Joseph Conrad's novel, written in 1904, the project took five years of work, involving four different scriptwriters and some of the most celebrated names in cinematic history, including Steven Spielberg, Alec Guinness, Marlon Brando and Peter O'Toole. But the effort involved proved too much for the director, whose mental and physical health declined dramatically during the course of the project and, ultimately, led to his death on 16 April 1991 at the age of 83 – six weeks before the film was set to shoot. Now 20 years on, the trials and tribulations of the film have come to light in scripts, notes and correspondence between the different parties involved, which have been donated by the David Lean Foundation to the British Film Institute.

The project first took shape for Lean in 1986 when he attempted to read Nostromo. Originally serialised in a magazine , the book tells the story of an Italian sailor, noted for his integrity, who becomes involved in a plot to smuggle silver out of the mining town of Sulaco in a South American country, Costaguana, when rebels seize power. But, as Lean admits in his own notes, "I spent most of the 200 pages fighting sleep." Nevertheless, he battled on, keen to bring the book to the big screen, but aware that it had to be changed to suit a "modern audience".

Download the new Independent Premium app Sharing the full story, not just the headlines

"I have a tremendous respect for Nostromo as a classic novel," Lean wrote. "But this respect could cause me to make a not so good, old-fashioned film. [Instead] I would like to use the book as a basis for a modern movie, which will make the audience sit up straight with surprise."

He adds: "If the film is a success most of those who go out and buy the book will give up long before page 200. This is exactly what happened to Seven Pillars Of Wisdom [TE Lawrence's own book on which Lawrence of Arabia was based], Doctor Zhivago and, to a lesser extent, Passage To India."

Its characters include Senor Gould, who owns the silver mining concession in Sulaco; Decoud, a young idealist who dreams of making Sulaco a separate state; the revolutionary Montero, who invades Sulaco; and, of course, Nostromo, the supposedly incorruptible Italian dockers' captain to whom Gould entrusts his silver so that it doesn't get into the hands of the revolutionaries. Nostromo accepts the mission, not out of loyalty to Gould, but rather because he sees an opportunity to increase his own fame.

The book plays out as an attack on the capitalist system as greed and self interest take over. Nostromo, together with the ruined cynic Dr Monyghan and Decoud, is able to restore some semblance of order to Sulaco by striking a deal with the warlords to aid Sulaco's secession from Costaguana and protect it from other armies. But this doesn't bring Nostromo fame, and, consumed by resentment, he lies about the whereabouts of the silver and tries to retrieve it for himself, leading to destruction and, ultimately, his death.

Lean got together with the playwright Christopher Hampton, who had already pitched the idea of Nostromo as a TV serial to the BBC, but had never got beyond the planning stage. They worked together for a year in two warehouses bought by Lean in London's Docklands. "It was like working on a film set," recalls Hampton. "A car would pick me up at 8am and take me to the site where David and I would work on several versions of the script [six in total], while looking out onto the river."

They also sent agents to Mexico to scout potential locations for the film, and began screen-testing actors, including a young, unknown Greek actor called Georges Corraface, for the role of Nostromo. Lean was so taken by him that he compared his audition to the moment Lean had first came across Omar Sharif for Lawrence of Arabia. "But, at the end of the screen test, Lean wasn't happy with the quality of the images and so he sacked the cameraman on the spot," recalls Hampton.

Around this time, another prominent figure entered the fray. Shortly before he began work on Empire of the Sun, Steven Spielberg came on board as producer, with the backing of Warner Bros. A long-time friend of Lean's, Spielberg got stuck straight into the script, writing endless notes about what he thought.

"Lean had a meeting with Spielberg in the US, but came back very annoyed with a load of notes handed to him by Spielberg. He couldn't believe it. David thought Spielberg's offer to produce the film was a courtesy, and didn't think he would actually offer opinions about the script," says Hampton.

In a memo (dated 12 February, 1987) full of similar observations, Spielberg tells Lean: "I would love to see Nostromo in scenes like this as a practical hero. It would be a big mistake to see Errol Flynn swashbuckling his way through a Conrad novel (this would be ridiculous), but some heroics, subtle yet justified, I think are a must for making him worthy of his title..."

Hampton points out: "Funnily enough, Spielberg had asked Lean for his opinion of the script for Empire of the Sun, which Lean thought was terrible, but he didn't think it was his place to say anything."

After a year of working with Lean, Hampton realised that they weren't making progress. Desperate to write the script for Dangerous Liaisons, after hearing that Milos Forman was planning to make a film, he asked Lean for six months off. "He reluctantly agreed. But then I got a phone call a few months later from him saying that he was getting Robert Bolt to write the Nostromo script instead."

Hampton is convinced the film could have been made in that first year. "But Warner Bros were only willing to put in 50 per cent of the money, and so Lean thought, if they can't be bothered to cover the full 100 per cent, then bugger it." Spielberg quietly pulled out of the project, with official reasons cited as differences of opinion on the script. He was replaced by Serge Silberman, a respected producer at Greenwich Film Productions.

Bolt and Lean got to work on new versions of the script. But problems soon began to surface and, after several late-night sessions, weariness and despair crept in. In one letter between Lean and Bolt (dated December 18, 1989), the director confides: "Until now I have been vaguely worried that the script does not quite measure up to many of Conrad's wonderful ideas. In a curious way we have a lot of wonderfully weighty scenes which are linked together by string."

Bolt's health also began to decline, and so Lean decided to write the script himself, assisted by Maggie Unsworth, with whom he had worked on the scripts for The Passionate Friends, Oliver Twist, Great Expectations and Brief Encounter. Several drafts (and years) later, they had the right script, but Lean's health was declining – so much that the production team had to take a $4m insurance policy for the director.

Lean took the decision to shoot a large part of the film in London and Madrid, not South America, partly to secure O'Toole, who had insisted he would only take part if the film was shot close to home. Lean also wanted Guinness to play Doctor Monyghan, but the aged actor turned him down in a letter from 1989: "I believe I would be disastrous casting. The only thing in the part I might have done well is the crippled crab-like walk."

The total budget shot up from around $30m to more than $46m (partly because of Lean's insurance cover) as more and more difficulties arose with the production. There were several heated arguments. Ulli Picard, the general production manager, in particular, was concerned with how the film was developing and relations were beginning to turn sour. "We will be pushed into a production with a tremendous amount of problems unsolved. I am not pessimistic, but realistic," he says in a letter to Silberman, dated 14 March 1989.

Silberman himself threatened to walk away from the project. In a letter to Lean (on 23 January 1990) he says: "Today I am not so shocked but just depressed, emotionally exhausted and very much saddened by the fact that your and my efforts have been all in vain. I have lost all desire and enthusiasm to make the film."

Casting was also proving difficult. Hampton recalls Dennis Quaid, Isabella Rossellini and Marlon Brando all being linked to roles in the film. "Lean spoke to Brando about playing a cut-throat gangster. But Brando just strung him along, saying it sounded interesting, as he did when Lean asked him to play the title role in Lawrence of Arabia."

Eventually Lean's health got so bad that he became bedridden. "I began thinking quite a lot about death," Lean reveals in his notes. "The other evening a great flight of geese passed by my window in the half dark. I did not even see them. It was the swoosh of their wings, beautiful but doom-laden, which arrested me."

Lean decided to try to incorporate those geese into the end of the film. "I would like to try and bring in the sound of those geese wings just before Nostromo dies. A triumph in death that he never experienced in life."

Lean died of throat cancer in 1991, a broken man and frustrated that he was unable to see the project through. His perfectionism and autocratic behaviour had alienated cast and crew, and delayed the start of filming for too long. Nevertheless, most who worked on Nostromo had an enormous respect for him. "I learnt so much from David in the time I worked with him," says Hampton. "It's no coincidence that my Dangerous Liaisons script was the best I had written."

Lean left behind a catalogue of films that have stood the test of time. In 1999, the British Film Institute compiled a list of the 100 favourite British films of the 20th century. Five movies by Lean appeared in the top 30 – Brief Encounter, Lawrence of Arabia, Great Expectations, The Bridge on the River Kwai and Doctor Zhivago. The first three of these were in the top five.

To celebrate David Lean's centenary, original production sketches of 'Nostromo' by Oscar-winning production designer John Box are on display at BFI Southbank until 3 August. Rediscover David Lean, the complete retrospective, plays there through June and July, and a selection of Lean's films will also screen at cinemas across the UK (www.bfi.org.uk/lean)