Criminal prosecution of gay men in Germany dates to the early middle ages. A national prohibition, Paragraph 175, was added to the Reich Penal Code in 1871. it read:
An unnatural sex act committed between persons of male sex or by humans with animals is punishable by imprisonment; the loss of civil rights might also be imposed.When the Nazi's came to power in 1933, they put a halt to efforts seeking reform of this law. In 1935, after the murder of Ernst Roem, the NSDAP amended the Paragraph 175 to close what were seen as loopholes in the current law.
The new law had three parts:
Paragraph 175: A male who commits a sex offense with another male or allows himself to be used by another male for a sex offense shall be punished with imprisonment.Paragraph 174 of the penal code forbad incest and other sexual offenses with dependents, while paragraph 176 outlawed pedophilia. Persons convicted under these laws also wore the pink triangle.
The Nazi's passed other laws that targetted sex offenders. In 1933, they enacted the Law Against Dangerous Habitual Criminals and Measures for Protection and Recovery. This law gave German judges the power to order compulsary castrations in cases involving rape, defilement, illicit sex acts with children (Paragraph 176), coercion to commit sex offences (paragraph 177), the committing of indescent acts in public including homosexual acts (paragraph 183), murder or manslaughter of a victim (paragraphs 223-226), if they were committed to arouse or gratify the sex drive, or homosexual acts with boys under 14. The Amendment to the Law for the Prevention of Offspring with Hereditary Diseases dated June 26, 1935 allowed castration indicated by reason of crime for men convicted under paragraph 175 if the men consented. A May 20, 1939 memo from Himmler allows concentration camp prisoners to be blackmailed into castration.