The Ayrshire town of Saltcoats is perhaps best known for its former popularity with Glasgow holiday makers and for the salt-harvesting which gave it its name. However, new research has thrown up the intriguing fact that one of history's unsung heroes was born in the town. Step forward Otto Kiep, the Scots-born Nazi resister who went on to become a key player in German attempts to overthrow Adolf Hitler and bring an end to the second world war.

Born in Saltcoats and brought up in Glasgow, Kiep was executed by the Nazis for his role in a daring attempt to assassinate Hitler on July 20 1944 - a story fictionalised in Valkyrie, released this week and starring Tom Cruise.

The Kiep family was prominent and popular in Victorian Glasgow society; Otto's father, Johann Nikolaus Kiep, was the German consul, while his uncle, Johan Carl, was a successful merchant in the city.

Kiep's link to Saltcoats is perhaps a little more tenuous, as he was born while his parents were on holiday there in 1886. His childhood was comfortable, spent at Hughenden Terrace with his three brothers and sister in Glasgow's west end, close to his cousins at Kelvinside.

But the Kieps' lengthy stay in Glasgow came to an end in 1909, when Otto's father retired and moved his family back to Ballenstedt in Germany. Here Otto's life diverged sharply from his cousin Walter's. Walter stayed in Glasgow and served as a doctor in the British army.

Once in Germany Otto studied law at the University of Leipzig. But, new to Germany, he never felt the nationalism of his peers. He studied in London too, and his flair for languages and appetite for other cultures led him to international diplomacy.

Kiep's Scottish background and his globetrotting career gave him an unusual, conflicted, but essentially liberal perspective.

His biographer, Bruce Clements, describes him as a citizen of the world, interested in the welfare of all peoples, whose philosophy and liberal upbringing in Scotland made him an excellent diplomat in the interwar period.

Kiep first showed signs of dissidence in 1933, when he attended a banquet in honour of Albert Einstein. He explained to his children: "The German New Order was regarded by Americans with more understanding than one might have expected. But this favourable atmosphere vanished as soon as anti-Jewish measures were taken in Germany Einstein, who was giving lectures in America at the time, was elevated to the position of one of the martyrs of international Jewry."

Kiep realised the significance of his attendance, and welcomed it - he wanted to distance himself from the rabid anti-Semitism in Nazi Germany. Sure enough, the Nazis promptly demanded his replacement. When the war began six years later Kiep was drafted into the High Command Foreign Affairs Office, a key position for resistance against Hitler. Here Kiep befriended Claus von Stauffenberg, the aristocratic leader of the resistance, played in Valkyrie by Tom Cruise.

As chief of staff at the Reserve Army headquarters, Stauffenberg had direct access to Hitler. After various abortive plans, on July 20, Stauffenberg placed a bomb under Hitler's table at a military conference. The bomb demolished the conference room and killed three officers and the stenographer, but Hitler survived with minor injuries.

Otto Kiep was arrested before the plan was carried out. He attended a tea party in September 1943, and, believing himself among friends, he voiced his moral objections to the Nazis, but he was betrayed to the Gestapo by an informer. Kiep was arrested by the SS on January 16, 1944.

After the tea party he confided to his sister Ida: "They try to liquidate everybody who sees through the party and its machinations if they're on my tail now it's because of what I said at the tea party."

Despite repeated torture, he refused to give any details of the forthcoming July 20 plot, or of any other co-conspirators. After it failed he was identified as one of those who had planned to assassinate Hitler, and was hanged on August 23 at Plotzensee prison; until now, a tragic, unsung Scottish hero of the German resistance.