The death this week of Eunice Kennedy Shriver, who fought most of her life for people with mental disabilities, has focused attention once more on perhaps the least-known of all Joe Kennedy Sr's children: Rosemary, confined to an institution at the age of 23 after an operation that went disastrously wrong. Eunice told the world of her sister's condition in 1962 in a moving magazine article (reprinted on the facing page) that is now widely seen as a turning point in the way society treats the developmentally disabled. It was essentially because of Rosemary, many believe, that Eunice founded the Special Olympics.

But Eunice makes no mention in her article of the operation Rosemary underwent in the autumn of 1941, referring to her sister throughout as "retarded" and insisting that she has now "found peace". In fact, it now seems likely that Rosemary was suffering from deep depression in the runup to the operation. In any event, it was to cure this condition that she underwent a prefrontal lobotomy – a procedure whose results were so disastrous that she spent the rest of her life in a facility in Wisconsin called St Coletta's. Famously ambitious for his clan, Joe Kennedy refused to tolerate any sign of weakness; he would subsequently tell journalists that his daughter taught retarded children. Later, the family described Rosemary as "mentally retarded" or "handicapped", which was apparently less embarrassing than "mentally ill" (and far less embarrassing than "victim of a failed lobotomy").

Rosemary Kennedy was born in 1918, the third child of Joe and Rose Kennedy. She was always seen as slower than her siblings, but was sweetly good-natured and in her teens could write perfectly correct letters, keep a diary, and do arithmetic. According to Ronald Kessel, author of The Sins of the Father: Joseph P Kennedy and the Dynasty He Founded, at the age of nine Rosemary could compute 428x32=13,696, meaning her IQ was well above the 75 usually used as the threshold for defining mental retardation in schoolchildren. When Joe was ambassador to London, she was presented to King George VI and Queen Elizabeth.

Soon after the family's return to America, however, Rosemary became increasingly assertive, and subject to violent mood swings. Her parents gave permission for a new, cutting-edge surgical procedure aimed at calming such behaviour, and then being pioneered in the US by Dr Walter Freeman. The first lobotomies – a procedure involving drilling holes in the skull to remove of part of the brain's frontal lobes or sever neural fibres connecting the frontal lobes to the part of the brain that govern emotional response – had been performed by a Portuguese neurologist, Antonio Moniz, in 1935; he won the 1949 Nobel prize for it.

The procedure was seen by some as the solution to a wide range of mental disorders, ranging from depression to schizophrenia and quite mild retardation. Some saw it as a way of dealing with misfits such as communists, gay people and disobedient children. Freeman, who went on to perform between 3,500 and 5,000 of the 50,000-odd lobotomies carried out in America until the early 1960s (a similar number were performed in the UK), used an icepick and rubber mallet to go through the top of the eye socket. It took 10 minutes; he eventually was doing it in a travelling van, his lobotomobile, and allegedly even in hotel rooms. He called the procedure "soul surgery", and claimed it relieved suffering – which, in some cases, it undoubtedly did.

Not for Rosemary Kennedy, though. Freeman and a colleague, James Watts, operated on her before they developed the eye-socket technique. "We went in through the top of the head," Watts told Kessler. "I think she was awake. She had a mild tranquilliser." As Watts cut down into the brain tissue with an instrument "like a butter knife", Kessler quotes Watts as saying, Freeman asked her to recite the Lord's Prayer, or count backwards: "We made an estimate on how far to cut based on how she responded. He talked to her. He would say, that's enough." It was immediately plain the operation was a disaster: it stopped Rosemary's violent behaviour but left her with the mental capacity of a two-year-old; incontinent and unable to speak intelligibly.

Kessel argues that what followed was one of the great cover-ups in medical history: no one in the family referred willingly to Rosemary; Joe made donations to philanthropic causes for the developmentally disabled; Eurnice founded the Special Olympics. Today, the lobotomy has largely been superseded by antipsychotic drugs, and is widely seen as barbaric. But it in a dozen or so countries, including the US and Britain, the procedure – infinitely refined, and now called NMD, or neurosurgery for mental disorder – remains a treatment of last resort for persistent severe depression, anxiety and obsessive-compulsive disorder.

Two hospitals in Britain, in Cardiff and Dundee, have carried out up to 10 operations a year over the past decade or so. In 2006, a neurosurgeon at Cardiff described the practice as "not a panacea", but added that in patients for whom all other treatment had failed, if it works well, "it transforms their lives".