With its delicately coloured row of harbour cottages, the village of Garlieston in south-west Scotland is a picture of seclusion and tranquility.

It’s hard to imagine the area was once effectively occupied as Britain’s military leaders desperately sought a way of breaking the Nazi stranglehold on Europe and ending the Second World War.

The move came after a stinging defeat in August 1942, when an Allied raid on the port of Dieppe went disastrously wrong.

Realising they would need the ability to get supplies across beaches during an invasion, the commanders chose Garlieston and nearby locations including Rigg Bay and Cairn Head to host a revolutionary engineering experiment that would culminate in the fabled Mulberry harbours – intricate floating structures considered essential to the success of the D-Day landings in Normandy on June 6, 1944.

Featuring flexible roadways that floated on steel or concrete pontoons, they were protected and reinforced by sunken caissons – immense chambers filled with water to keep them fixed on the seabed.

“It’s no exaggeration to say that the Mulberry Harbour turned the course of the war,” said Roy Walter, a historian who lives in Garlieston.

“The allied forces would never have got back into northern France without it. [They] had been booted out... and the Germans had heavy protection in place for all the harbours on the coast.

“British Vice-Admiral John HughesHallett said that ‘the only way we were going to get back in was to take our harbour with us’.

He was being flippant but lots of military commanders thought, ‘that’s actually a good idea’.

“There was lots of activity at Rigg Bay but the first inkling that the estate factor had about the presence of the military was signs going up on the estate fences saying military property – please keep out. There was no consultation.”

Garlieston is just one of several locations north of the Border that played a crucial role in preparing troops for D-Day. From the Tarbat peninsula to Highland lochs, the country’s contribution was huge.

But, for Mr Walter, the technical ingenuity involved makes the work that took place in his village particularly notable.

“The area was chosen for the evaluation of three prototypes owing to its remoteness and beach conditions similar to northern France,” he said.

“Of the three prototypes, two were quickly eliminated. The pier head for the one that was sent to war was based on quite an old design by Lobnitz and Co, which was based in Renfrew.

“The key innovation was the floating roadway designed by Allan Beckett, who was a military engineer. He designed it pretty much from scratch and that is what made the whole thing work.

“The contribution that the geography provided was absolutely huge because it meant that prototype evaluation was able to take place beyond the reach of German reconnaissance and pretty much out of sight.”

The components were later assembled and towed out to France under the noses of the enemy.

“Perhaps the most striking thing about the project was the timescale,” said Mr Walter. “When you think about civil engineering projects now the timescales just go on and on, as do the budgets, whereas here we are talking about a project that went from a cold start in 1942 to trials in 1943 and full implementation on D-Day in June 1944.”

As well as hosting experimental engineering work, Scotland became a vast training camp.

On the beaches of the Moray Firth and along the Tarbat Peninsula, army, navy and artillery units were put through their paces, honing the ability to launch coastal assaults and deliver live gunfire support.

Elsewhere, castle estates such as Inveraray and Achnacarry hosted thousands of soldiers who learned how to deploy small landing craft which were vital to the June 6 landings.

“The beauty of Scotland is that it was unlikely to be raided by the Luftwaffe,” said historian Simon Forty, whose book, D-Day UK: 100 Locations in Britain, charts sites where the attack was planned and prepared for.

“It was out of the way. It provided the armed forces with protected water and inlets that they could use.

“There’s a strong case for saying that the training that took place in Scotland was the most important for the actual D-Day landing itself because it was in Scotland that troop training with landing craft took place.”

For Bob Towns, President of Nairn Legion, the sheer scale of activity underlines the importance of memorials such as the one erected on the town’s links to honour the 3rd British Infantry Division.

“Walking along the seafront of Nairn on a bonny day, without something like the memorial being there, you would never know what went on,” he said.

“That’s where the team was built up... so that, when it came to the actual day, they knew one another, they knew how the others operated, and that helped them get the men ashore. Without [that] training, I am sure the casualties would have been far higher. It’s something that we cannot forget.”