Warning: Includes content that may be disturbing to some, including a brief description of a traumatic childhood accident.

In the 1960s, the theory of social conditioning was a dominant force in psychology. Researchers were exploring the ways that the world could shape our identities, and gender was one piece of the puzzle. Many psychologists believed that gender was learned — in other words, that it was just one more behavior sculpted by social influence.

This wasn’t idle watercooler talk. When psychologists met with intersex patients, they needed to help them make decisions about surgery, hormone treatments, and other medical interventions that would alter the course of their lives. (Intersex is a broad category that includes people who have sexual anatomy that doesn’t fit the typical definition of male or female.) Decades later, these cases help inform our understanding of gender.

One of the most dramatic examples is the case of David Reimer. In 1965, a botched circumcision with an electrocautery needle burned away eight-month-old David Reimer’s entire penis. His distraught parents made a life-altering decision, and brought him to see John Money, a celebrated psychologist at John Hopkins university, who had reputation as an expert in gender identity.

John Money knew he couldn’t recreate what David has lost, but he thought he could create a reasonable facsimile of female genitalia. He convinced the parents that David could still live a full and happy life — if his gender was changed and David was raised as a female. The fact that David had a twin brother also made the pair an all-too perfect test case for his theory that gender roles and sex preference could be reprogrammed by social influence.

Under Money’s direction, doctors removed David Reimer’s testicles. His parents changed his name to Brenda, and he was raised as a girl. When David reached adolescence, they used estrogen supplements to start puberty, causing him to develop breasts. And for 20 years, Money touted his success, wrote glowing research papers, and triggered a small avalanche of sex reassignment operations in difficult cases across the country.

David/Brenda was the ultimate experiment to prove the power of social conditioning over raw biology. Except it didn’t work. At two years old, David tore off dresses and fought to get toy cars and guns from his twin brother. In school, he was bullied mercilessly for his apparently masculine traits. At home, he told his parents that he felt like a boy. Meanwhile, Money wrote in an academic paper that “The child’s behavior is clearly that of an active little girl and so different from the boyish ways of her twin brother” — perhaps because David’s parents were lying to him, or perhaps because he was too deeply invested in his idea of gender malleability to perceive what was really happening.

When David finally learned the truth at age 14, he felt a sense of deep relief. With the help of testosterone injections, a double mastectomy, and genital reconstruction surgery, David returned to life as a man. Three years later, he married a woman.

Sadly, the changes were too little to late. David never fully recovered from his ordeal. At age 38 he committed suicide with a shotgun in a grocery store parking lot.