Across five decades the American psychiatrist and lawyer Richard Green, who has died aged 82, contributed to landmark achievements for gay and trans rights, risking his reputation and career to advance the understanding and acceptance of sexual and gender minorities.

In 1962 the US immigration service had moved to deport a Nicaraguan man, Chester Morales, on account of his homosexuality – despite the fact that he had lived in the US for a decade. Green was his expert witness and the challenge to his deportation was successful – a groundbreaking legal victory.

Later, in 1972, Green published a pioneering paper calling for the removal of homosexuality from the American Psychiatric Association’s list of mental disorders, despite being advised that it would ruin his career. The following year he reiterated his call at the APA annual meeting and the organisation removed homosexuality from the list.

He was an early advocate of same-sex marriage, making the case for marriage equality in a debate on the US television series The Advocates in 1974, when equal marriage was opposed by 90% of Americans. The same year, in Ohio, in a period when lesbian mothers invariably lost child custody or child visitation rights upon divorce from their husbands, Green was the first expert psychiatric witness in a US court hearing, Hall v Hall, in which the mother was victorious.

He went on to testify in more than a dozen similar cases. In 1979 he submitted an affidavit in support of two Californian gay men who wanted to co-adopt a child, during an era when adoption by gay couples was effectively banned. With his help, they scored an important success.

Green was also a trailblazing facilitator of gender reassignment surgery. In the mid-1960s he saw patients with Harry Benjamin, who was then the only American physician treating trans people. In the absence of US medical programmes for transgender people (called transsexuals in those days), Green referred American patients to Europe for surgery.

While on sabbatical in Britain in 1980, he participated in the first child visitation rights case, C v G, involving a transgender parent. A father, transitioning to live as a woman, wanted continuing access to his child. The mother objected. Green was the psychiatric expert for the father and helped him win the case.

Back in the US, Green became involved when Eastern Airlines refused to permit a pilot, Kenneth Ulane, who had flown as a male for 16 years, to return to the cockpit after gender reassignment to become a woman. Green was an expert psychiatric witness for the pilot, and won the initial case in 1983, although it was later overturned on appeal.

After graduating in his 50s from Yale Law School, which he attended from 1984 to 1987, Green merged his psychiatric work on sex and gender with law, and in 1992 tackled the subject in a book called Sexual Science and the Law. As a newly qualified lawyer he worked with the American Civil Liberties Union and in 1990 was co-counsel in one of the first legal challenges against homophobic discrimination by the Boy Scouts of America. They were refusing to permit a gay man, Tim Curran, to be an assistant scoutmaster; the Boy Scouts won, and the ban on gay men remained in place until 2014.

In 1991 Green wrote an affidavit in support of Joseph Steffan, a star student at the US Naval Academy who had been refused graduation after it was revealed that he was gay. The case for his reinstatement was lost, and it was not until 2011 that gay men were finally accepted into the military.

Green was born in Brooklyn, New York, to Leo, an accountant for the International Ladies’ Garment Workers Union and Rose Ingber, who was a teacher and later a civil servant. He was raised as a secular Jew. He attended Syracuse University from 1957 until 1961, becoming the first graduate of that university to be accepted at the Johns Hopkins School of Medicine, securing his place in an era when the school limited Jewish students to 10% of the total enrolment.

As a medical student at Johns Hopkins, Green studied with the innovative sex and gender psychologist John Money. When later training to be a psychiatrist at University of California, Los Angeles (UCLA), he collaborated with Robert Stoller, an expert in gender identity. He completed his psychiatry training at the National Institute of Mental Health in Bethesda, Maryland, 1964-66, and was then awarded a fellowship assignment at the Maudsley hospital in London, 1966-67. Throughout his career he held many academic posts, including as professor of psychiatry emeritus at UCLA and visiting professor of psychiatry at Imperial College, London.

Among Green’s publications, which include eight books and 200 papers and textbook chapters, he co-edited the first multidisciplinary text (Transsexualism and Sex Reassignment) on what was then referred to as sex change. His studies of transgender adults and gender non-conformist boys were documented in Sexual Identity Conflict in Children and Adults (1974); later his book The Sissy Boy Syndrome and the Development of Homosexuality (1987) examined the tormented, stigmatised childhoods of feminine boys, who, by and large, matured into gay men.

Detailed accounts of his many medical and legal battles were collected in his last book, Gay Rights, Trans Rights: A Psychiatrist/Lawyer’s 50-year Battle (2018).

He is survived by his son, Adam, from his marriage to Melissa Hines, which ended in divorce in 2014.

• Richard Green, psychiatrist, lawyer and campaigner, born 6 June 1936; died 6 April 2019