One of the most influential figures in modern psychiatry has apologised to America's gays for a scientific study which supported attempts to "cure" people of their homosexuality.

The survey, published in 2001, looked at "reparative therapy" and was hailed by religious and social conservatives in America as proof that gay people could successfully become straight if they were motivated to do so.

But Dr Robert Spitzer has now apologised in the same academic journal that published his original study, calling it "fatally flawed". "I believe I owe the gay community an apology," his letter said. "I also apologise to any gay person who wasted time and energy undergoing some form of reparative therapy because they believed that I had proven that reparative therapy works."

Spitzer's letter, which was leaked online before its publication in the Archives of Sexual Behaviour, is sure to cause delight among gay civil rights groups and stir up anger among social conservatives, who have used the study to combat the acceptance of homosexuality as a normal part of human society.

Reparative therapy is popular among Christian conservative groups, which run clinics and therapy sessions at which people try to become heterosexual through counselling. Gay rights activists condemn such practices as motivated by religious faith, not science, and call them "pray away the gay" groups.

Spitzer's study looked at the experiences of 200 people undertaking the therapy, including subjects that had been provided by religious groups. He then asked each person the same set of questions, analysing their responses to the therapy and their feelings and sexual urges afterwards. He concluded that many of them reported feelings of changes in their sexual desires from homosexual to heterosexual.

Spitzer's stance was notorious, because in 1973 he had been instrumental in getting the American Psychiatric Association to stop classifying homosexuality as a mental disorder in its diagnostic manual: a move seen at the time as a major victory for gay rights.

His 2001 study caused a huge stir because many people felt that it was not rigorous enough for publication. The central criticism was that Spitzer had not paid enough attention to the fact that subjects might lie about their feelings or be engaged in self-deception.

For more than a decade Spitzer shrugged off the attacks and stood by his work, but he has now admitted that his critics were right. "I offered several (unconvincing) reasons why it was reasonable to assume that the subject's reports of change were credible and not self-deception or outright lying. But the simple fact is that there was no way to determine if the subject's accounts of change were valid," Spitzer wrote.

In an interview with the New York Times last week, Spitzer, who is 79 and suffers from Parkinson's disease, described how he had written his letter of recantation in the middle of the night after agonising over the study's impact.

He had also recently been visited by a gay magazine journalist, Gabriel Arana, who had described to him his own experience going through reparation therapy and how damaging it had been and how it had led to thoughts of suicide. "It's the only regret I have; the only professional one," Spitzer told the New York Times, which described him as being almost in tears as he talked about his decision to admit he was wrong.

"In the history of psychiatry I don't know that I've ever seen a scientist write a letter saying that the data were all there but were totally misinterpreted. Who admitted that and who apologised to his readers. That's something, don't you think?" Spitzer told the newspaper.

Gay rights group Truth Wins Out published the full text of the letter on its website and hailed the moment as a major step forward. "Spitzer's apology to the victims of 'pray away the gay' therapy … marks a watershed moment in the fight against the 'ex-gay' myth," the group said.