They were meant to show that gender was determined by nurture, not nature - one identical twin raised as a boy and the other brought up as a girl after a botched circumcision. But two years ago Brian Reimer killed himself, and last week David - formerly Brenda - took his life too. Oliver Burkeman and Gary Younge unravel the tragic story of Dr Money's sex experiment

Until a few years ago, the name David Reimer meant little to those outside his immediate circle, and by the time he killed himself last Tuesday in unknown circumstances in his hometown of Winnipeg, it was already slipping back towards obscurity - a name belonging to nobody more remarkable than a local odd-job man, a 38-year-old former slaughterhouse worker who was separated from his wife, and enjoyed shopping at flea markets and tinkering with his car.

In fact, to anyone taking an interest in the development of psychology in the 1970s and 1980s, Reimer's life story would have long been infamous, but also pseudonymous. Going by the name "John", and subsequently "Joan", David Reimer had been an unwitting guinea-pig - along with his identical twin brother Brian - in a medical experiment at first celebrated, then notorious. Masterminded by a prominent Baltimore physician, John Money, it was an attempt to settle, once and for all, the fraught nature-versus-nurture debate: to prove that gender was so fluid that by a mere change in childrearing practice, plus a little surgery, a boy could be turned into a girl, while his twin developed as a male.

It would split the world of sexual psychology in two. And after 12 years of traumatising treatment, followed by a further two decades spent attempting to repair the damage, it would drive David Reimer to his death."It was like brainwashing," Reimer once said, having resumed his male identity after a childhood spent as Brenda. "I'd give just about anything to go to a hypnotist to black out my whole past. Because it's torture. What they did to you in the body is sometimes not near as bad as what they did to you in the mind."

The tragedy has its roots in what seemed like a routine trip to hospital in 1966 for Janet and Ron Reimer and their twin baby boys, Bruce and Brian. Doctors had recommended circumcision, a practice still routine in much of north America, but Bruce's operation went distressingly wrong. Like almost every detail of the story, what actually happened is still fiercely disputed but what is clear is that the electric cauterising machine being used by doctors caused burning to his penis so severe as to render the organ unrescuable.

Reconstructive genital surgery was still rudimentary, and medical experts could offer only pessimism. So when the despairing parents happened to catch a television show, some months later, on which John Money was propounding his radical new theories about gender formation, it seemed to offer a lifeline. "He was saying that it could be that babies are born neutral, and you could change their gender," Janet Reimer later told John Colapinto, author of a book on the experiment entitled As Nature Made Him.

In photographs taken at the time, Money - then, as now, affiliated to Johns Hopkins University in Baltimore, Maryland - looks like a parody of a progressive "sexologist", turtlenecked and moustachioed, and his writings did nothing to dispel that impression. Raised in a conservative religious family in New Zealand, he had rebelled and become a self-described "missionary of sex", revelling in shocked responses to his tireless advocacy of open marriages and - a particular favourite - bisexual group sex.

At their most extreme, Money's public statements had appeared to endorse, or at least not to condemn, incest and paedophilia, but there was no hint of that in the television show Janet and Ron Reimer saw. They wrote to him, and he wrote swiftly back. He was confident, he said, that Bruce could be successfully raised as a girl. From an experimental perspective, Brian Reimer would provide the perfect control: his genetic inheritance was identical to Bruce's. The only difference was that one would be nurtured as a girl, and the other as a boy.

Money's emphasis on nurture over nature played well with the progressive spirit of the times, and especially with the women's movement, its proponents eager to establish that women's traditional social roles were not biologically pre-ordained. "Postwar, in any case, there was a move away from people being innately, biologically, inherently anything," says Lynne Segal, professor of psychology and gender studies at Birkbeck College in London. "We'd just seen Nazism, and the emphasis had been put on the idea that certain people were innately evil - Jews and gypsies, among others - so the emphasis on culture and society fitted well with social democratic ideals." The Reimers did not engage in this kind of debate. "I looked up to [John Money] as a god," Janet said simply.

Bruce Reimer started to become Brenda on July 3, 1967. Physicians at Johns Hopkins surgically castrated him, and the remaining skin was used to forge a "cosmetic vaginal cleft". Money sent the family back to Winnipeg with strict instructions. "He told us not to talk about it," Ron Reimer told John Colapinto. "Not to tell [Brenda] the whole truth, and that she shouldn't know she wasn't a girl."

Things started going wrong almost immediately. Janet Reimer recalled dressing Brenda in her first dress just before the child was due to turn two. "She was ripping at it, trying to tear it off. I remember thinking, 'Oh, my God, she knows she's a boy and she doesn't want girls' clothing." Brenda was bullied viciously at school. When she urinated standing up in the school lavatories, she was threatened with a knifing.

Whether all the blame should lie with Money remains a matter of contention. His supporters argue that reconstructive surgery techniques of the time were such that trying to turn Bruce into Brenda might genuinely have been the least worst option. In public, Money advertised the "John/Joan" study as a resounding success. "This dramatic case," Time magazine reported, picking up on his salesmanship, "provides strong support for a major contention of women's liberationists: that conventional patterns on masculine and feminine behaviour can be altered."

In private, though, things were spinning into chaos. Brenda was required to attend regular therapy sessions with Money in Baltimore, in the company of her brother. According to Colapinto's account, they soon degenerated into horrifying encounters that deeply traumatised the two children. Showing the children "explicit sexual pictures" was seemingly central to Money's theories of gender reassignment. David Reimerlater recalled, as Brenda, "getting yelled at by Money ... he told me to take my clothes off, and I just did not do it. I just stood there. And he screamed 'No!' I thought he was going to give me a whupping. So I took my clothes off and stood there, shaking."

In the children's grimmest recollection - one they found almost impossible to talk about years later - Money allegedly made "Brenda assume a position on all fours on his office sofa and make Brian come up behind her on his knees and place his crotch against her buttocks", an element of Money's theory he referred to as "sexual rehearsal play". (The author John Heidenry, who wrote a recent review defending the sexologist, calls this charge "outrageous and offensive", and says Brian, the source of the claim, may have been suffering false memory syndrome.)

By the time Brenda reached her teens she had attempted suicide at least once; she refused further surgery but consented, though irregularly, to take oestrogen supplements to encourage the development of breasts. John Money gradually drifted from the Reimers' lives, but Brenda remained under constant psychiatric treatment. It was after one such session with a Winnipeg psychiatrist in 1980 that Ron Reimer collected his daughter in the car and, instead of taking her home, drove her to an ice-cream parlour, where he told her everything.

The upturn in Reimer's fortunes lasted several years. Brenda opted for a sex change within weeks of her father telling her the truth. Thanks to developments in phalloplasty, Brenda, taking the name David, received surgery that after five years left him with a reconstructed penis resembling a real one, with limited sensation, and usable for sex. When he was 23 he met Jane, a single mother of three, and married her soon afterwards. In 2000, he went public with his story.

But his happiness didn't last. For reasons that remain unclear, David and Jane eventually separated. Then, two years ago, Brian Reimer apparently killed himself, taking an overdose of drugs he was taking for schizophrenia. David reportedly felt responsible for the death, and visited Brian's grave daily, weeding the plot and bringing fresh flowers.

Despite Colapinto's claims that David made a large amount of money from the book, those who knew him said he was often hard up; at the Transcona golf club, in Winnipeg's eastern suburbs, where he did odd jobs, the members had a whip round for him so he could afford to eat. Friends say he had became particularly distraught during the last few months after he bought thousands of dollars' worth of shares in an investment that flopped.

The world of psychology learned of the failure of Money's experiment through a paper by a rival, Dr Milton Diamond, of the University of Hawaii, who eventually traced those who had taken over treatment of the twins. For Lynne Segal, the story of the experiment does not settle the nature/nurture debate one way or the other - her view, widely shared today, is that the dichotomy is false - but it shows the perils of psychologists trying to prove too much through research. "It's far too simplistic, and far too interventionist, this idea that we can control and model and shape people to prove one thing or another."

John Money remains an emeritus professor at Johns Hopkins. "He's not commenting on this story," his assistant told the Guardian yesterday. "There is no comment to make."

· As Nature Made Him by John Colapinto is published by Quartet, priced £10.