During the chaos of the American Civil War, following the Union's setback at the Second Battle of Bull Run, the film delves into the daring and risky operations of espionage and loyalty. The story begins at a Union military hospital where the Pauline Cushman Players perform for wounded soldiers, providing a distraction amidst wartime despair. Among them is Pauline (a character played by an actress whose page is /actor/pauline-cushman), a courageous spy working for the renowned detective agency of Allan Pinkerton. She recognizes the potential in her close friend and fellow showgirl, Gail (/actor/gail), and recommends her to become a spy for the Union, especially after the previous Operator 13 has been caught and executed.
Gail disguises herself in blackface and assumes the identity of an African American maid, often referred to as "Octaroon" in the film, to accompany Pauline southward into enemy territory. This undercover role is perilous, as the Confederate forces quickly become suspicious of anyone acting as a spy. When Captain Jack Gailliard (/actor/gary-cooper) learns about the presence of a spy, he is tasked with uncovering their identity. Gail overhears General Stuart's conversation while doing laundry—learning that the general plans to attend a ball that very night—adding layers of danger to their mission. During the ball, Gailliard finds evidence suggesting Pauline's involvement in espionage, leading to her arrest as she attempts to escape. Her refusal to reveal her contacts results in her being sentenced to death, but both she and Gail manage a daring escape back to Union lines.
The storyline takes a twist when the Pinkerton agency arranges for Gail to bait Gailliard in a trap, turning her into a symbol of Union heroism within Southern newspapers. She adopts the alias Anne Claiborne (/actor/anne-claiborne), and her publicity efforts help secure her pardon from President Abraham Lincoln himself. As she heads back south, Gailliard, now genuinely attracted to her, begins to see her in a different light. However, their fragile connection is threatened when Gail, warned by a fellow spy and Stuart’s groom, is recognized as a spy. To protect herself, she flees disguised in a Confederate uniform, leading to a tense pursuit.
Gail and Gailliard eventually find refuge in an abandoned farmhouse. Gailliard captures her, but before he can take action, Union soldiers arrive nearby. They mistake the groom, still in Confederate attire, for a spy and shoot him dead. Unseen, Gail and Gailliard witness the execution of a Confederate soldier by a Union firing squad, a stark reminder of the brutal realities of war. In a poignant moment, Gail confesses her love for Gailliard and refuses to betray him, even as Confederate forces launch a final attack. Amidst the chaos of battle, she persuades Gailliard to escape and return to his side.
The war culminates with the surrender at Appomattox Court House, signifying the end of hostilities. In the final scenes, Gail and Gailliard reconcile, having navigated the perilous lines of loyalty, love, and espionage in one of America's most defining conflicts. Their story is a testament to bravery, sacrifice, and the complex nature of human allegiance during wartime.