President Trump’s proclamation by tweet last month that he was banning transgender people from serving in the military in “any capacity” is the latest twist in a thoroughly modern controversy. Trump’s declaration overturns a policy only recently put in place by the Obama White House as the armed forces continue to grapple with modern issues of gender identity and sexual orientation. Caught off guard by the sudden shift, Gen. Joseph F. Dunford Jr., the chairman of the Joints Chiefs of Staff, told military leaders: “There will be no modifications to the current policy until the President’s direction has been received by the Secretary of Defense and the Secretary has issued implementation guidance.”

Listen to this story on “Retropod”:

On Friday, Trump directed the Pentagon to move forward with the ban, but will allow Defense and Homeland Security department officials to determine the fate of transgender people already in the military. He also ordered the Pentagon to stop providing sex reassignment medical treatments, according to a presidential memorandum signed Friday.

Behind the 21st century contretemps is a history that predates the musket.

“They wouldn’t know what in the world you meant by the world transgender, but there have women serving in men’s dress in armies since the beginning of wars,” said Elizabeth Leonard, a professor of history at Colby College. “It’s a story that we keep losing sight of.”

Cross-dressing has roiled the ranks of armies at least as far back as Joan of Arc, the 15th century military genius who was burned at the stake for heresies that included wearing a man’s uniforms. Leonard’s own expertise is the Civil War, a time when the ranks were filled with hundreds of women who cut their hair, put on pants and took up arms on both sides of the War Between the States.

Researchers at the National Archives have found evidence that at least 250 women dressed as men to fight in the 1860s, some motivated by ideology, some by a taste for adventure and some by the need for a job. Most of those who survived presumably returned to their lives as women. But others continued to live as men after the war.

Albert Cashier was born Jennie Hodgers in Ireland, immigrated to the United States as a stowaway and, at 18, enlisted in the Illinois Infantry Regiment as a man. After the war, in which he fought in some 40 actions, Cashier continued to dress in trousers and, in the modern parlance, identify as a man. He worked as a farmer and handyman for decades and missed out an army pension after refusing to take a required physical exam, according to scholar Jason Cromwell, the author of “Transmen and FTMs: Identities, Bodies, Genders and Sexualities.”

Cashier’s anatomical secret only came out after he was injured in a 1911 car wreck and treated by doctors. He was committed to an insane asylum but when his story was reported in newspapers, his former army comrades rallied to ensure he was buried as a soldier and recognized on a monument at Vicksburg as one of the Illinois soldiers who fought there.

Sarah Rosetta Wakeman was driven by poverty to work as a male canal boatman and then sign up with a New York unit to fight for the Union Army. The teenage girl passed as a 21-year-old man named Lyon Wakeman and bagged a $154 signing bounty. Recruits were not always closely examined, Leonard said, particularly toward the end of the war when armies on both sides were desperate for “men” of any kind. Among boys barely past puberty, the smooth face of a female impostor could easily have passed without remark.

“If you had teeth to tear open a cartridge and a working thumb and forefinger, that was enough,” Leonard said.

Wakeman died in New Orleans of dysentery after the Red River Campaign and was buried under a stone monument to “Lyon Wakeman.”

In addition to women who concealed their true gender, others created their own. Leonard’s favorite example is Mary Edwards Walker, a New York physician who served as the only woman surgeon for the Union Army.

A portrait of Dr. Mary Edwards Walker, a Union Army surgeon during the Civil War who dressed as a man for most of her life. (Courtesy of Library of Congress)

During a remarkable career (which included being arrested as a spy for treating the wounded behind enemy lines), Walker never claimed to be a man, but she insisted against all custom on dressing as one. She was known as the Little Lady in Pants in her army years, and she adopted more masculine garb as time went on. By the end of her life, she wore a top hat and tails.

That proved even more controversial than the cross-dressers who completely adopted a male/soldier identity, who were often hailed as heroes when their story was uncovered.

“People tended to celebrate the courage of the women who cut their hair and passed as men,” Leonard said. “But they had no idea what to do with Mary Walker. She really was the precursor for the idea of ‘I am just going to be who I am.’”