Soon after the outbreak of World War One, the Germans sent a spy to Edinburgh to gather intelligence. The untrained spook's "amateurish" methods soon led to him being caught and executed by firing squad at Tower of London.
Towards the end of August 1914 a man checked into what is now the Balmoral Hotel in the centre of Edinburgh claiming to be an American tourist.
In reality he was a German spy who had been sent to gather intelligence from the British.
Carl Lody, by now 37 years old, was a junior naval officer who had been forced to retire for health reasons but was looking for other ways to serve the fatherland.
"He was especially attractive to German naval intelligence because he had lived for years in the United States and spoke English fluently, although with an American accent," according to Peter Jackson, professor of history at the University of Glasgow.
He says Lody was asked to focus in particular on the Firth of Forth, which was of special strategic importance because it was a "very significant deep-water harbour" which always had a number of important British warships at anchor.
The Forth Bridge was also seen as a vital strategic artery connecting southern Britain with Scotland's north eastern seaboard, which looked out on to the North Sea and the German high seas fleet.
Lody travelled under the alias of Charles Inglis, having obtained a bogus passport in this name from the American consulate in Berlin, by claiming to have mislaid his passport.
Prof Jackson says: "Lody's methods of communication were very amateurish. It showed that he had been given almost no training before having been dispatched to Great Britain via Norway.
"He communicated mainly by telegram or by post to a German agent in Stockholm named Adolf Buchard.
"Buchard was on the watchlist for MO5 (now MI5), the British counter-intelligence, and all of the communications between anyone in Britain and Buchard were monitored.
"Letters were opened, telegrams were recorded and monitored and it was in this way that MO5 became aware that a German spy was operating in Edinburgh, very soon after Lody began his activities."
During his weeks in Edinburgh, Lody sent regular messages in English and German to his contact in Stockholm.
Some of these were allowed to go through because they contained misleading information that would alarm the Germans but cause no harm to Britain.
The poor quality of his reporting was demonstrated by letters he sent about a supposed landing of "large numbers of Russian troops", repeating a rumour that thousands of Russians "with snow on their boots" had been sent to fight on the Western Front.
Prof Jackson says: "This was of course nonsense but the fact that Lody reported it without comment suggests that he was not the most critical of intelligence collectors."
After almost a week at the North British Hotel, Lody became worried that his presence was attracting attention.
Lody left the hotel and requested that it re-addressed his letters to the Cunard Co. in Liverpool.
However, instead of moving to Merseyside, he took a room at a boarding house at 12 Drumsheugh Gardens in Edinburgh.
Prof Jackson says: "There is some evidence that the family with whom he was lodging had become suspicious of his activities.
"There was the fact that he would go out on a bicycle every morning and come back quite late in the evening. There was also some idea that his accent had begun to betray him."
But even before the suspicions of the family, Lody was being watched by the British intelligence services.
Prof Jackson says: "He was being shadowed by a member of special branch.
"It appears that Lody thought it would be a good idea to take the heat off by travelling across country to Liverpool and then to Ireland."
After he had written a letter with detailed intelligence on the state of several British warships in Liverpool harbour, the decision was made to arrest Lody.
He was tracked to a hotel in Killarney on his way to Queenstown (now Cobh in County Cork), which was the largest British naval station in Ireland.
After his arrest he was taken to London where he was put on trial, charged with spying for Germany, convicted and executed by firing squad at the Tower of London on 6 November 1914.
Prof Jackson says: "Lody's was the first execution carried out at the tower for 150 years.
"Lody's behaviour was impeccable during his trial. He refused to give the names of any of his superiors in German naval intelligence. He also seems to have been resigned to his fate and to meet it with honour and courage, commensurate with that of a German officer."
The day before his execution Lody wrote to his family saying that knowing he was to die "in the service of the Fatherland" made death easy.
He added: "I have had just judges and I shall die as an officer, not as a spy. Farewell."