The history of psychiatry and homosexuality illuminates how stigma develops in the professions, how it is linked to cultural values and religious attitudes and how it affects patients. Homosexuality was medicalised as a disorder in the late 19th century and this led to treatments to change it. Same-gender contacts between men were decriminalised in many countries in the 1960s and 1970s, but – as recently as the 1980s – 30% of doctors in the USA did not think that gay students should be admitted to medical school and 40% would not allow gay doctors to specialise in paediatrics or psychiatry. Lesbians and gay men were effectively debarred from training in the main psychoanalytical schools in the USA and the UK. Although mainstream psychological treatments to make gay and bisexual people heterosexual fell into disrepute in the 1980s, so-called conversion or reparative treatments took their place and are still practised today. Transgender people have been the target of similar disapproval and attitudes towards them have been even slower to change than those towards lesbians and gay men. This stigma had consequences on the health, well-being and social inclusion of those who were lesbian, gay, bisexual and transgender (LGBT). This history suggests we need to examine where psychiatry and psychology are making similar mistakes today.