To celebrate International Day against Homophobia, Transphobia and Biphobia on 17 May, the GCHQ building in Cheltenham was lit up with the colours of the rainbow.
Until 1991, GCHQ, the intelligence agencies MI5, MI6 and the Foreign Office would not employ openly gay men or women.
Today, more than 100 employees within GCHQ are members of the agency's Pride network, which aims to promote sexual diversity.
A spokesman for the intelligence agency told the Sunday Times: "For GCHQ, illuminating the building in rainbow colours is a public statement about its pride in its diverse workplace, is a testament to how far the organisation has come."
In 2013, a posthumous pardon was granted to Alan Turing, the gay mathematician and codebreaker. He helped crack Germany's Enigma code, but lost his security clearance after he was convicted in 1952 for gross indecency. Two years later, he committed suicide from cyanide poisoning.
"His later life was overshadowed by his conviction for homosexual activity, a sentence we would now consider unjust and discriminatory and which has now been repealed," said Justice Minister Chris Grayling.
Turing's nephew Sir John Dermot Turing said he was "delighted" by GCHQ's gesture, adding: "My uncle, Alan Turing, made a crucial contribution to the safety of the nation when he worked for GCHQ's forerunner Bletchley Park but due to society's attitude at that time he was forced to hide his sexuality.
"It is important that his successors at GCHQ today are free to be themselves and, therefore, bring their talents to such vital work."
The intelligence agency is now using careers fairs to recruit gay people to "improve the diversity" of GCHQ.
"We are part of an under-represented group and we want to reflect that diversity of the nation GCHQ services," said Ben who is a member of its Pride network.