Under a deadly barrage of artillery fire, wave after wave of Union troops hurled themselves across an open field outside of Fredericksburg on a bitterly cold mid-December day and charged up a steep hill in a futile attempt to dislodge Confederates dug in atop Marye’s Heights.

By nightfall, nearly 13,000 Union troops lay dead or wounded — double the number of fallen Confederates — and a “young and good-looking” corporal from New Jersey that a comrade described as “a real soldierly, thoroughly military fellow,” was promoted to sergeant for bravery.

One month later, the sergeant, a veteran of the Seven Days Battle and Antietam, gave birth to a baby boy.

“What use have we for women, if soldiers in the army can give birth to children?” an astonished Col. Elijah H.C. Cavins, of the 14th Indiana, wrote to his wife.

The New Jersey sergeant, whose name and fate have been lost to history, was not the only woman disguised as a man fighting at Fredericksburg that day. Sarah Emma Edmonds, using the alias Pvt. Franklin Thompson, spent 12 hours on her horse, often under enemy fire, delivering dispatches as the orderly to Union Gen. Orlando M. Poe.

A portrait of Frances Clalin Clayton, a woman who disguised herself as a man, "Jack Williams," to fight in the Civil War. She served in the Missouri artillery and cavalry units and is seen here circa 1865. (Samuel Masury/LIBRARY OF CONGRESS PRINTS AND PHOTOGRAPHS DIVISION)

A teenaged Lizzie Compton, who fellow soldiers knew as Jack or Johnny, was discovered to be a woman only after the battle when military doctors peeled her blue uniform away to treat a shrapnel wound to her side. Discharged — it was illegal to serve in the military as a woman — Compton would go on to reenlist in and be discovered by six more regiments and serve in the Union army a total of 18 months.

In January, the Pentagon agreed to allow women to fight in combat. But what was ignored in that controversial debate was the long-forgotten history of hundreds of American women who had fought bravely in the nation’s wars, won battlefield citations for valor and died on the front lines.

Their ranks include Deborah Sampson, who served for 17 months in the Continental Army during the Revolutionary War as Robert Shurtliff, and Lucy Brewer, who served with the Marines aboard Old Ironsides as George Baker during the War of 1812. And historians have found that an estimated 400 to 1,000 women, perhaps more, disguised themselves as men and took up arms in the Civil War.

“We just lifted the ban on women in combat as if it were a new phenomenon. It’s not. said Elizabeth Leonard, a historian at Colby College in Maine who has studied women soldiers of the Civil War. “It’s that we let these stories disappear.”

DeAnne Blanton, a military historian at the National Archives, and Lauren Cook Wike have spent more than a decade meticulously combing diaries, letters, burial records, military reports and newspapers documenting the service of women soldiers.

In their book, “They Fought Like Demons,” they found evidence that at least 250 women dressed as men and fought for the North and the South in virtually every major battle of the bloody Civil War.

At least eight women combatants fought at Antietam. Catherine Davidson’s right arm was amputated. Mary Galloway was shot in the neck. A woman fighting for the Confederates died in the Cornfield. Five women fought at Gettysburg. One Confederate woman was shot in the leg, and two were cut down in Pickett’s Charge.

The tide of war begins to turn in favor of the Union

Women soldiers fought in the First Battle of Bull Run. “There were a great many fanatic women in the Yankee army,” a Georgia Confederate wrote home, “some of whom were killed.” In fighting near Dallas in May 1864, several Confederate women soldiers were killed in an assault on Union lines. “They fought like demons,” Sgt. Robert Ardry of the 11th Illinois Infantry wrote to his father, “and we cut them down like dogs.”

Confederate Loreta Janeta Velazquez, disguised as Lt. Harry T. Buford, fought along with five other women soldiers in the Battle of Shiloh. Maria Lewis, an African American passing as a white male soldier, served in the 8th New York Cavalry and “skirmished and fought like the rest,” a fellow soldier wrote. Four Confederate women were promoted to the rank of captain. At least one was a major.

“We know that because these women were hiding the fact that they were women, they were fully expected to do everything that any other soldier in the company was expected to do,” Blanton said. “They didn’t get a pass because of their gender. They were hiding their gender.”

It was easy for women to infiltrate the Union and Confederate ranks. Although Army regulations required all recruits to have a physical, the examinations became cursory as each side became desperate for fresh troops. “Often, they’d just have recruits walk by, “ Blanton said. “And if they weren’t lame or blind and if their trigger finger worked, they were in.”

(The Army became serious about entrance physicals in 1872, Blanton said: “The Civil War was really the last time women could sneak into the army and pass herself off as a man.”)

Because so many soldiers were teenaged boys who had yet to shave, a woman’s beardless face went unnoticed. The ill-fitting uniforms hid their shape, most soldiers rarely bathed and everyone slept in their clothes.

When armies were camped out in the field, it would have been easy for these women to slip away into the woods to take care of bodily functions, Blanton surmised, and months of marching, poor nutrition and the stress of combat most likely interrupted many menstrual cycles.

Sometimes, just the fact that the women wore pants and acted in a way wholly unexpected in the prim, Victorian era of hoop skirts and fainting couches gave them cover. “I readily recall many things which ought to have betrayed her,” Gen. Poe, Sarah Edmonds’s commanding officer, later confessed, “except that no one thought of finding a woman in soldier’s dress.”

Women were found out only if they were wounded, got sick, were taken prisoner or, as with the New Jersey sergeant and five other soldiers, gave birth.

Their service became an open secret. Fellow soldiers wrote home about them and chronicled their exploits, if not their names, in their diaries. Stories romanticizing their adventurous spirits and extolling their patriotism appeared in the New York Times, the Richmond Examiner and the Chicago Daily Tribune. Edmonds and Velazquez penned popular memoirs.

“No editor can turn over a morning’s ‘exchange papers’ without encountering authentic anecdotes of some fair and fast Polly or Lucy who, led by the spirit of patriotism, love, or fun, has donned the blue breeches and follows the drum,” wrote the United States Service magazine.

Even Abraham Lincoln knew of the women in uniform. Mary Ellen Wise, who took a minie ball in the shoulder in the Battle of Lookout Mountain, came to Washington to ask for her back pay. When the paymaster refused, Lincoln “blazed with anger” and ordered the injustice rectified, the Washington Daily Morning Chronicle reported in its story, “Brave Soldier Girl” on Sept. 30, 1874.

But over time, the stories of these outed women soldiers were forgotten. And once the war was over, hundreds more who’d made it through undetected, learning to spit, smoke, chew tobacco, swear, play cards and swagger like a man, slipped out of their uniforms and into obscurity.

For nearly 50 years, the Adjutant General’s Office denied women soldiers existed. And Confederate Gen. Jubal Early, who, as head of the Southern Historical Society, carefully crafted the noble Lost Cause narrative of the war, dismissed Velazquez as a hoax and other women soldiers as prostitutes.

Soon, historians, if they took any notice at all, dismissed women soldiers as “crazy, whores, or homosexuals,” Blanton wrote.

For more than a century, only the family of Pvt. Lyons Wakeman, 153rd Regiment, New York State Volunteers, knew that the body buried in Chalmette National Cemetery near New Orleans was that of a woman, Rosetta Wakeman. She’d died of dysentery, as many soldiers did, after a long, hot march from Alexandria to Louisiana.

Wakeman, who grew up on a farm, was working as a man on the canal boats before she enlisted. She was like many of the women soldiers Blanton has found — working-class city girls who toiled in factories or as seamstresses in the North for about $4 a month or semi-literate farm girls from both North and South.

“If you were being paid starvation wages as a woman, $13 a month, which was the Union army pay for a private, sounded pretty good,” Blanton said.

Some women followed husbands or sweethearts into battle. Others, like Kentucky Confederate Mary Ann Clark, whose husband abandoned her and their two children, then took up with a new wife, left her kids with her mother and became Henry Clark to escape her sorrows.

Charlotte Hope, a.k.a. Charlie Hopper, of Fairfax joined the 1st Virginia Cavalry to avenge the death of her fiance, vowing to kill 21 Yankees for every year that he’d lived. She was later killed in a raid.

Orphan Frances Hook was about 17 when she took the name Frank Miller and enlisted in the Union Army with her brother; she did so because she didn’t want to be left alone. When her brother was killed at Shiloh, she continued to fight, ultimately getting captured on a scouting mission in Alabama.

Some women wanted the freedom that came from living as a man. Lizzie Cook admitted to the Missouri Democrat that her “strong impulse to shoulder a musket” came from a desire to escape the “monotony of a woman’s life.”

“The fact that women were willing to risk injury, illness, maiming and even death to escape the kind of lives that were available to them at the time, tells you something about just how limited their choices were,” said Leonard of Colby College.

“I’m as independent as a hog on ice,” Rosetta Wakeman wrote gleefully to her family. “I will dress as I am a mind to for all anyone else [cares], and if they don’t let me Alone they will be sorry for it.”

Wakeman’s letters, which were not published until 1994, are the only known collection of letters by a Civil War woman soldier. They weren’t unearthed until Wike’s dust-up with the National Park Service. She’d dressed as “Larry” for a reenactment of the battle of Antietam in 1989, blew her cover by using the women’s restroom and was kicked out of the park. “The superintendent of the park said I would have to have a sex change in order to portray a soldier there,” Wike said. “So I took them to court.”

She won. In the ensuing publicity about her case, Wakeman’s descendants contacted Wike and asked if she’d like to see the letters that they’d found in an attic trunk.

Although Wakeman never got the chance to carry out her plan to live and dress as a man after the war, an Irish immigrant named Jennie Hodgers did.

Hodgers, barely 5-foot, 3-inches tall, had been living as a man before the war to get a fairer factory wage. She spent three years in the 95th Illinois Infantry as Pvt. Albert D.J. Cashier and lived as a man for the next 45 years until she was hit by a car and the doctors treating her discovered her sex.

She was later committed to an insane asylum and forced to wear a dress, which she pinned to make into pants. When the Pension Bureau threatened to strip her of her pension, her army comrades rallied to her defense.

One relayed how Hodgers had climbed a tall tree under sniper fire to attach the Union flag after it had been shot down. Another wrote that she’d been captured on a reconnaissance mission outside Vicksburg and escaped by grabbing her guard’s gun, knocking him down and outrunning her captors.

When Hodgers died in 1915, her fellow soldiers made sure she was buried with full military honors.

“We need to keep telling these stories,” Leonard said. “We need to keep fighting the historical stereotypes about women that actually don’t fit the reality of their lives. Otherwise, American history will be told as a thin narrative, when in fact it’s so rich and complex and full of surprises like this.”

Against all odds and every social convention of the time, women soldiers were in the ranks during the Civil War. They fought. They bled. They died. We should know that, Leonard said. And, unlike in the past, remember.

Researcher Jennifer Jenkins contributed to this report.