Where did the stereotype of Germans being kinky/fetishistic originate?

by pearphone

One of the many German stereotypes, apart from working hard and being generally stoic, is the prevalence of kinky and fetish-based sex. Where did this start and what is behind the stereotype?

Justin_123456

As a follow-up, what is the relation (if any) between this stereotype and the popular reaction to the work of figures like Freud or Hirschfeld?