One day in 1779, a London couple, seeking treatment for their seven-year-old daughter, showed up at the Soho Square Dispensary for the Relief of the Infant Poor. The first doctor thought she might have a hernia. The second had a different idea.

“I shall not trouble the reader with the surprise into which the parents were thrown when I first told them their child was not a girl, as they had supposed, but a boy,” wrote the second doctor. The case was recently discovered in the archives of the University of Kansas and written up in the latest issue of the journal Sexualities.

In the early 2000s, Carol Warren—then a professor of sociology at the University of Kansas—was researching the history of electricity in the college’s rare books library when she noticed an old pamphlet with an eye-catching title: “The case of a boy who had been mistaken for a girl; with three anatomical views of the parts, before and after the operation and cure,” by a surgeon called Thomas Brand. “I was looking through a bunch of materials that had been shoved together, and this one appeared,” recalls Warren.

According to Brand's report, published in 1787, he noticed an “irregularity” in the patient’s “external parts.” After further examination, he concluded that the child’s “part, which had the appearance of the labia pudenda, was in fact the scrotum,” and suggested an “operation to free the penis from its confinement.” He went ahead and made some alterations, enabling the child—whose name is unknown—“to urinate standing up, wear trousers, and enjoy the privileges of being a male.” Brand, who practiced at the Royal Hospital at Greenwich, was “not a quack,” according to Mary Fissell, a professor of the History of Medicine at Johns Hopkins who I spoke to on the phone.

Eight pages long, with three illustrations of the child’s anatomy, the pamphlet may describe one of the earliest instances of sex-change surgery. “The first case that I found (in America) was in the 1840s, and it was received quite critically by fellow physicians,” writes Elizabeth Reis, author of Bodies in Doubt: An American History of Intersex and professor of women's and gender studies at the University of Oregon, in an email.