In 1871, a national prohibition, Paragraph 175, was added to the Reich Penal Code. 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 Nazis came to power in 1933, they put a halt to efforts seeking reform of this law. In 1935, after the murder of Ernst Rohm, 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. Where a party was not yet twentyone years of age at the time of the act, the court may in especially minor cases refrain from punishment.
Paragraph 175a: Penal servitude up to 10 years or, where there are mitigating circumstances, imprisonment of not less than three months shall apply to: (1) a male who, with violence or the threat of violence to body and soul or life, compels another male to commit a sex offense with him or to allow himself to be abused for a sex offense; (2) a male who, by abusing a relationship of dependence based upon service, employment or subordination, induces another male to commit a sex offense with him or to allow himself to be abused for a sex offense; (3) a male over 21 years of age who seduces a male person under twentyone years to commit a sex offense with him or to allow himself to be abused for a sex offense; (4) a male who publicly commits a sex offense with males or allows himself to be abused by males for a sex offense or offers himself for the same.
Paragraph 175b: An unnatural sex act committed by humans with animals is punishable by imprisonment; the loss of civil rights might also be imposed.
Paragraph 174 of the penal code forbade incest and other sexual offenses with dependents, while paragraph 176 outlawed pedophilia. Persons convicted under these laws also wore the pink triangle.
The Nazis passed other laws that targeted 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 compulsory castrations in cases involving rape, defilement, illicit sex acts with children (Paragraph 176), coercion to commit sex offenses (paragraph 177), the committing of indecent acts in public including homosexual acts (paragraph 183), murder or manslaughter of a victim (paragraphs 223226), 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.
Sources: People with a History: An Online Guide to Lesbian, Gay, Bisexual and Trans History, http://pwh.evansville.edu/