A UK diplomat left a sensitive telegram from Prime Minister Harold Wilson to the US president in a London bank, but managed to keep his job, papers reveal.
The top secret telegram discussed the Vietnam War
National Archives documents show Murray MacLehose, who was working for Foreign Secretary George Brown, was behind the "very grave security breach" in 1967.
And it was the intervention of Mr Brown that saved Mr MacLehose, who later became governor of Hong Kong.
He told the PM, Mr MacLehose was "a hell of a good fellow".
He had been working "extremely long hours with little sleep", Mr Brown said of his principal private secretary.
The papers, released for the first time by the archives in Kew, west London, detail how the telegram from Mr Wilson to US President Lyndon B Johnson discussed the Vietnam War.
It was left in the Regent Street branch of the Bank of Scotland, but in a stroke of fortune for Mr MacLehose, it was found by another diplomat and returned to the Foreign Office.
But there was still pressure to punish Mr MacLehose, particularly given that a squadron leader in the Ministry of Defence was facing a court martial for another security breach involving documents left in an unlocked drawer.
Eventually George Wigg, the paymaster general and Mr Wilson's Cabinet enforcer, was persuaded to accept that there were differing degrees of "culpability" between the two cases.
Mr MacLehose's career survived and as well as the Hong Kong post, he was also ambassador to Vietnam for a time.
He was named a life peer in 1983 and died in May 2000 at the age of 82.