A child of a beautiful, talented woman and ambiguous paternity craves learning. Adopted by a Spanish officer and an "uncle" who is a painter, s/he is sent off to Edinburgh as a pedagogic experiment to become James Barry, a male medical student. Barry adores the vivacious Alice, an illiterate but intelligent servant, whom he teaches to read.
Later as a doctor and medical officer, he travels the world to the Crimea, to the Caribbean, to South Africa and America, a scion of society and a good scientist. By happy fortune, he lives in retirement with Alice, who has become a famous actress. The book ends with the scandalous revelation of Barry's femininity when his body is laid to rest.