Today is the 70th anniversary of Denmark’s liberation from Nazi rule by British troops. The Danes are rightly proud of their anti-Nazi resistance and their heroism in saving the lives of almost all their Jewish citizens. But Denmark also had a dirty little secret that remained hidden for many decades.

A Danish Nazi, SS Dr Carl Værnet, conducted medical experiments on gay concentration camp prisoners. Unlike most other Nazi doctors, he was never put on trial at Nuremburg. Instead, with Danish and British collusion, he was able to escape to Argentina, where he lived openly and continued his research into methods for the eradication of homosexuality.

Værnet was a Copenhagen doctor who, realising the opportunities offered by the homophobic policies of the Third Reich, joined the Nazi party and enlisted in the SS to pursue his research to “cure” gay men.

This research was conducted on the personal authority of Heinrich Himmler. The Gestapo chief demanded the “extermination of abnormal existence … the homosexual must be entirely eliminated”.

The campaign to expose Værnet only took off in 1998, when I wrote to the then Danish prime minister, Poul Rasmussen, calling for an inquiry into Værnet’s wartime activities. Media coverage of this letter triggered a public outcry in Denmark, where most people had been unaware of Værnet’s war crimes and the high-level measures taken to shield him from prosecution.

Rasmussen passed the buck to the ministry of justice, and it passed the buck to the National Archives of Denmark.

Refusing to launch an inquiry into Værnet’s crimes and his escape from prosecution, the ministry of justice advised me to conduct the criminal investigation. They referred me to the Danish National Archives to secure the necessary evidence. But the archives told me the files on Værnet were classified and closed until 2025.

Faced with mounting public, media and parliamentary pressure, the Danish government eventually relented. Access was given to the previously top secret files. They revealed Værnet’s medical Nazism, his protection by the postwar Danish state and inaction by Allied war crime prosecutors.

Værnet had been a member of the Danish Nazi party from the late 1930s. As a doctor, he specialised in hormone research; including treatments to “cure” homosexuality.

After Denmark was occupied by the Nazis, few patients visited Værnet’s clinic because of his pro-Hitler sympathies. This prompted him to approach the Nazis, who were well known for their hatred of gay people and their bid to “eliminate the perverted world of the homosexual”. Værnet met the chief Nazi doctor, Reichsarzt-SS Ernst Grawitz, who proposed that he research the treatment of homosexuality on behalf of the SS.

This led to Værnet operating on gay prisoners in Buchenwald concentration camp, inserting artificial hormone glands in their groins. Two of these men died from infections caused by the insanitary conditions.

Værnet was given a permit to go to Sweden and was even paid a state stipend

When Denmark was liberated on 5 May 1945, Værnet was arrested and detained at Alsgade Skole prisoner-of-war camp in Copenhagen. It was run jointly by the British military and the Danish police. The head of the camp was a British major, Ronald F Hemingway, who declared Værnet “undoubtedly will be sentenced as a war criminal”.

Despite this prediction, Værnet appears to have convinced the British and Danish authorities that his hormone treatments to turn gay men heterosexual were important, worthy scientific research.

In November 1945, in response to Værnet’s claim that he was suffering from a serious heart condition, Hemingway authorised his transfer to a Copenhagen hospital. In fact, the medical records show that Værnet’s heart tests were normal and that he received no treatment during his hospital stay.

In August 1946 a medical colleague of Værnet’s informed the Danish public prosecutor that his deteriorating health required urgent vitamin E treatment that was only available in Sweden. Astonishingly, Værnet was given a permit to go to Sweden and was even paid a state stipend to support himself.

Letters written by Værnet in this period don’t mention his declining health. Instead, they state “everything is ready in Argentina” and “the money is ready in Sweden”.

The Danish police were informed in 1947 that Værnet had settled in Buenos Aires. He was living there under his own name and had resumed his hormone research with funding from the Argentinian ministry of health. Despite calls for this prosecution, the Danish government decided against extradition proceedings.

Værnet remained in Argentina until he died in 1965, living there with the full knowledge of the Danish and Allied authorities. They made no attempt to prosecute him for war crimes, possibly because they regarded his research to “cure” homosexuality as legitimate, even commendable.

The Danish authorities have still not explained why Værnet and his Danish protectors were shielded from prosecution and why it took my public challenge to force them to open the Værnet files. I’m still waiting for an answer.