Hundreds of British Nazi sympathisers were recruited into a network of spies and saboteurs during the second world war, never realising that the man they thought was their Gestapo controller was actually a UK agent.
Thanks to "Jack King", the operative whose real identity is still classified, British secrets including the development of the jet engine were kept from the Germans.
The amazing tale has been concealed until now, with King's agents apparently living the rest of their lives unaware that their covert service for Germany had actually been for Britain.
MI5, the counter-espionage service, even arranged for some to receive German medals.
A November 1941 document described how MI5 had set about infiltrating pro-Nazi circles by looking at employees of the engineering company Siemens Schukert, which it said ran "a vast espionage organisation for the German government".
While most of the company's staff in Britain had returned to Germany or been interned, MI5 identified the sister of one of them, Dorothy Wegener, as being a member of a "correspondence club".
An MI5 officer began corresponding with Dorothy and as she continued to respond, MI5 decided to push for a meeting.
A trained agent took up the role of King, but this man's identity is concealed in files revealed on Thursday. Eight months later, his operation had developed.
With the help of faked paperwork, he was now claiming to be a Gestapo agent and found the woman who would become his key contact - Marita Perigoe.
The files described her as having her own network, a member of which reported that the British were working on "a new type of tail-less aeroplane which ran on low-grade fuel." MI5 recognised this as a jet engine.
Perigoe's collaborators wanted to take information like this to the Spanish embassy, where it could be passed to Germany. King was able to persuade them he would pass it on instead.
As the war continued, the network grew, enabling MI5 to identify potential saboteurs, as well as Britons who were inadvertently leaking information.
It was agreed not to prosecute network members after the war due to fears they would say King acted as an agent provocateur.