Image copyright The Ronald Grant Archive Image caption James Bond director Guy Hamilton, pictured here on the set of Goldfinger, was a secret agent during World War Two

That James Bond creator Ian Fleming drew literary inspiration from his wartime work in espionage is relatively well known. But the heroic World War Two exploits of the director of Bond films including Goldfinger and Live and Let Die are less well documented.

Guy Hamilton, who grew up in France but was sent to boarding school to England, made an early foray into the film industry in the late 1930s, but after fleeing France at the outbreak of war his film-making career had to be put on hold while he joined the effort to defeat Nazi Germany.

In June 1944, he found himself in the sort of dire straits that would have challenged Bond himself.

On a mission to drop French secret agents in Brittany, Lt Hamilton and his crew of two sailors became stranded in a place crawling with German soldiers.

Under cover of darkness, Hamilton and his crew had rowed to shore from his navy ship in a small surfboat to drop off the agents. But when he headed back the ship had gone. There was no way of returning home.

Image copyright Dartmouth Museum Image caption Hamilton ran covert high-speed motor gun and torpedo boats out of Dartmouth for the Royal Navy's 15th Flotilla

Image caption Hamilton used the Shelburne Line, one of a series of crucial Allied escape routes that crisscrossed occupied France

Plymouth's Honorary French Consul Alain Sibril, who was born in Brittany and whose grandfather was part of the local Resistance, said: "This was shortly after D-Day, it was extremely, extremely dangerous.

"You can imagine it was a terrible place to be stuck."

Speaking to BBC Inside Out before his death last year, Hamilton said the events of that time were still etched on his memory: "My worries were to get rid of the surfboat and to try and get as far away form the beach as possible."

He spent several days on the run with two other sailors, evading German patrols and navigating minefields.

They were eventually rescued by the French Resistance and sheltered in a safe house run by Anne Ropers.

Image caption Hamilton (right) spent a month in Brittany pretending to be a Frenchman to avoid detection

Image caption Anne Ropers hid Hamilton and two other agents for about a month

In an interview before she died last year Mrs Ropers, then 97, said: "They stayed in my parents' room. At night, Guy was in one bed and the sailors in the other.

"By day, all three of them spent their time lying on their beds, so that they did not make any noise."

Mr Sibril said: "Had the Germans discovered Guy Hamilton and his fellow sailors, this would have been extremely dangerous. Not only for them, but also for the whole network of Resistance fighters."

Marguerite Pierre, 92, was another Resistance member who helped Lt Hamilton.

She said: "We were told by our commander that we risked either deportation or being shot in the field. We knew what the risks were."

Image caption Hamilton managed to send a message back to his naval crew in Dartmouth telling them he was safe

One night Hamilton's cover was almost blown, when members of the Resistance took him for a boozy game of boules.

He said: "They took me down the road to a cafe that had a bowling alley in the back.

"Well that was alright except that it was full of Germans all in uniform, having a drink. And the lads said 'can we have the bowling alley after you Fritz?', and they said 'yes, yes'… I was appalled and horrified."

Mrs Ropers said: "Each team bought the other a jug of cider. The Germans bought a jug of cider for the Englishman and vice versa."

Image copyright Hulton Archive Image caption Sir Roger Moore said Hamilton "was very much a James Bond character himself"

Hamilton would recall these experiences while directing James Bond films, as 007 actor Sir Roger Moore recalls.

He said: "He did tell me that he was once dropped into Nazi-occupied France and, being separated from his squad, found himself in a fairly sticky situation in a French village teeming with German soldiers.

"By virtue of speaking fluent French he was able to pull the wool over the Germans' eyes in a bar by pretending to be a local, and he was obviously very convincing."

For nearly a month Hamilton managed to avoid detection before escaping back to safety in England. Ten days later the escape route used by the Resistance was uncovered by the Nazis.

Image copyright The Ronald Grant Archive Image caption After the war Guy Hamilton worked in the film industry training under Carol Reed

Image copyright Keystone Image caption The first Bond film he directed was Goldfinger in 1964

Image copyright Fox Photos/Getty Images Image caption Hamilton directed a series of war films including Battle of Britain in 1969

Image copyright REX/Shutterstock Image caption He lived in Majorca until his death last year, aged 93

Hamilton would be awarded the Distinguished Service Cross for his gallantry.

After the war he returned to the film industry, training under legendary director Carol Reed on movies such as The Third Man, later directing blockbusters including The Colditz Story and Battle of Britain, as well as four Bond movies - Goldfinger, Diamonds are Forever, The Man with the Golden Gun and Live and Let Die.

And for Moore, Hamilton's experiences in the Royal Navy informed the way he helped to bring Bond to life on the silver screen.

"Guy was very much a James Bond character himself," the actor said.

"He always knew what was believable and how far he could take audiences - and that was based on both his film-making experience and real wartime exploits."

Guy Hamilton's daring exploits can be relived on Inside Out South West on BBC One on Monday 6 February at 19:30 BST and on the iPlayer for 30 days thereafter