He was a notorious Scots safe-cracker who became a secret weapon in the war against Hitler.

Now Johnny Ramensky is back in the spotlight thanks to the hit TV reality show Secret Agent Selection: WW2, set in the Scottish Highlands.

The show sees ordinary people take part in the same gruelling process which churned out secret agents who were parachuted behind enemy lines into 1940s Nazi-occupied Europe.

In the last episode Johnny Ramensky was hailed as the man who taught SOE agents how to break in and out of buildings, and how to pick locks and handcuff. He was also described as an expert with explosives who was key to undermining the Nazi war effort.

But before and after the war Ramensky was a burglar who spent years behind bars for blowing open safes with gelignite. He won the nickname Gentle Johnny because he never used violence. And he escaped from prison several times, even staging a rooftop protest at Barlinnie in 1931.

Born in Glenboig in 1905, Ramensky moved to the Gorbals with his mother aged eight after the death of his Lithuanian father. He swiftly became a local rogue, spending time in Polmont Borstal for his bad behaviour.

Ramesky learned how to use explosives when working in the pits as a miner and put them to good use until he was sentenced to 18 months in prison for 16 housebreakings.

So began a life of crime which saw him spend an estimated 40 years in prison, which was only punctuated by his extraordinary service during the Second World War.

Well-known Scottish journalist Robert Jeffrey, who wrote the book Gentle Johnny Ramensky, said: “When the war started he wanted to contribute something. He went to the governor of Peterhead Prison, where he was being held at the time, and asked for help to join the forces after he got out.

“The governer recognised he was something special and that he could be extremely helpful to our secret services. He served his full sentence and was collected by MI5 agents at the gate.”

Ramensky was known for his athleticism and aced basic military training before he was parachuted behind enemy lines in Nazi-occupied Europe. One early success was at the Italian port city La Spezia.

Jeffrey said: “Johnny was able to hide himself in the mountains and used a compass to direct RAF bombers to the harbour. He was also a smashing saboteur and blew up a lot of railway lines. And after the Germans fled Rome, Johnny was able to recover a huge volume of secret documents from locked safes, which were very helpful in the conclusion of the war.”

Ramensky also spent time in North Africa and almost had the opportunity to kill Nazi military commander Erwin Rommel.

“He broke into Rommel’s headquarters and unfortunately Rommel was on the front line,” said Jeffrey. “Had Rommel been there the course of the war would have changed because he would have been prepared to kill him. Of course, he did also break into Rommel’s safe and got plans that were helpful.”

After the war Johnny went back to his old ways, even jumping off the train to blow open a safe on the way back to Glasgow hours after he was demobbed.

Jeffrey said: “He went to blow a safe at a bank in York because his criminal contacts tipped him off. I think he was an adrenaline addict. Burglary is very exciting stuff. He seemed to like danger.

“When he got back to Glasgow he became a folk hero because people had heard about his exploits in the army. Various people offered him employment, including one of the big demolition companies. But that wasn’t exciting enough for him.

“Even in his declining years when his physicality began to leave him he still couldn’t settle down. He tried to be a bookie but lost all of his own money, because he was a gambler. He never really went straight.”

Ramensky died aged 67 in 1972 while a prisoner in Perth. He kept diaries which were burned by prison authorities, but one early extract survived.

It read: “Each man has an ambition and I have fulfilled mine long ago. I cherish my career as a safe blower. In childhood days my feet were planted in the crooked path and took firm root. To each one of us is allotted a niche and I have found mine. Strangely enough, I am happy. For me the die is cast and there is no turning back.”