Material found in the archives has revealed that British government officials in the early 1970s struggled over whether gay people should be promoted to senior positions amid fears they could be open to blackmail.
Seven years after the 1967 Sexual Offences Act decriminalised homosexuality in England and Wales, senior civil servants also expressed concerns about whether gay officials would command respect from staff.
In minutes from a meeting in January 1974, managers note that at the time, anyone found to be gay would be "unlikely" to be promoted to a top level.
It added: "Opinion at the grass-roots had not changed sufficiently for it to be possible to rule out the risk of pressure of, or actual, blackmail, and that an overt homosexual would not be able to command the necessary respect from his staff or colleagues."
The managers agreed the issue was "beset with difficulties", although later memos said there should be no blanket ban on promoting gay officials, but cases should be decided on an individual level.
The foreign and defence ministries were particularly reluctant to change their policies on gay staff, documents from the same era show.
Top defence ministry official Michael Cary suggested homosexuals could be found "niche" jobs, saying: "Such individuals are still black-mailable even if their homosexuality is known to the department".
"I recall a case, some time ago, where the blackmailer had threatened to reveal the official's homosexuality (which we knew about) to his mother."