A secret base in Scarborough played a key role in resolving the Cold War's Cuban missile crisis, it can now be revealed.

Up on a hilltop, not far from a caravan park in England's North Yorkshire coast sits what is believed to be the longest continually running listening station in the world.

The GCHQ base at Scarborough was established just before World War One because its position was ideal to intercept German naval radio signals in the North Sea.

During World War Two, it helped locate German U-boats in the Atlantic. By the Cold War it shifted to monitoring Soviet communications.

Staff would work in a dank, often smelly bunker.

Image copyright GCHQ

"The room was full of people, headphones on. Your role was to not miss a beat," explained one veteran.

"If you wanted to go to the toilet, you had to put your hand up, somebody's got to come in and take your place," says Sheila, the current director of the base who, like other staff, only gives her first name to protect identities.

During the Cold War, the US and UK, along with Australia, Canada and New Zealand, formed the so-called "five eyes" which divided up intelligence gathering around the world.

Scarborough's focus was the Soviet Baltic fleet but it was also assigned Soviet merchant shipping in the northern hemisphere.

'Top priority'

In 1962, this normally relatively unimportant responsibility suddenly thrust the base into the centre of world affairs.

"Traditionally just another task at the bottom of Scarborough's priority list, suddenly escalated to the very top priority for British intelligence," Tony Comer, GCHQ's historian tells the BBC.

President John F Kennedy was told on 16 October that the Soviet Union was secretly shipping nuclear missiles on to the island of Cuba, just 90 miles from America.

Some of his advisers - including the military - pushed for an immediate invasion of the island but Kennedy opted instead for a naval blockade on further shipping arriving, which was announced on the evening of 22 October.

Some Soviet ships were already on their way to the island. The question was whether they would break through the blockade. If they did, the risk was a conflict which could escalate into nuclear war.

The operators in the Scarborough bunker were able to intercept the Soviet ships reporting back their position and then use that to establish where they were heading.

Image copyright Naval History and Heritage Command Image caption The Joseph P Kennedy was used in the blockade of Cuba during the 1962 Cuban missile crisis

"Were the Soviets going to call Kennedy's bluff or not? Scarborough was the organisation that was able to say exactly where these vessels were, when they stopped sailing towards Cuba and when they turned around and headed back to the Soviet Union," explains Mr Comer.

A key report sent by Scarborough - entitled Soviet Merchant Ship Changes Course - has just been declassified.

White House line

It says that on 24 October the Kislovodsk - a Soviet cargo ship - reported a position north-east of where it had been 24 hours earlier confirming it had "discontinued" its voyage and turned back towards the Baltic.

The next day, reports show more ships originally bound for Cuba alter their course and return to Soviet ports. On the surface the reports, some parts of which are still classified and blacked out, are no different from others Scarborough would have distributed in normal times.

But in this case a copy was also sent straight to the White House Situation Room. They would provide the first indications that the crisis was not going to escalate.

Within days, talks began which would bring the world back from the brink of war.

Part one of The Secret History of GCHQ is on BBC Radio 4 on Monday 21 October at 20:00 BST and on BBC Sounds.