The first female doctor in Britain spent 56 years disguised as a man. It wasn’t until after her death in 1865, that the doctor’s secret was finally discovered.

In 1826 in a southern suburb of Cape Town, South Africa, a frail-looking doctor with red hair prepped his instruments for a highly dangerous procedure—a cesarean operation. Once Dr. James Barry, a Royal British Army surgeon who was no taller than five feet, had assessed the severity of the patient’s contractions, he saw there was no other choice. The newborn needed to be removed surgically.

Barry had read of only three cases where both the mother and the child survived. None of them were performed in the British Empire. But Barry had a unique perspective to most doctors of the time.

“Aside from his expertise in midwifery, he had a secret advantage,” writes Michael du Preez and Jeremy Dronfield, experts who have written extensively about Barry’s life. “There was not another practicing physician or surgeon in the world [in the 19th century] who knew from personal experience what it was like to bear a child.”

Barry became the first doctor in the British Empire to perform a successful cesarean operation. It was one of many major medical contributions the Irish surgeon accomplished for the British military, from enforcing stricter standards for hygiene, improving the diet of sick patients, to popularizing a plant-based treatment for syphilis and gonorrhea. Barry served around the globe, eventually earning the title of Inspector General, the second most senior medical position in the British Army.

But despite these achievements, Barry’s reputation was kept a secret for nearly a hundred years. The military locked away the doctor’s records after finding out Britain’s Inspector General was born a woman.