One hundred and fifty-eight years ago, on the morning of October 18, 1859, the radical abolitionist John Brown found himself surrounded in Harpers Ferry, Virginia, by an armed force much larger than his. Two days before, Brown had led a daring raid on a federal armory, hoping that its capture would catalyze the rapid abolition of slavery in the United States. But a local militia quickly cornered Brown’s small band of 19 men, five of whom were black. Soon, a group of U.S. Marines arrived with orders to retake the armory.

As dawn broke, Brown received a written demand that he surrender. The Marines had been “sent by the President of the U. S. to suppress the insurrection at this place,” it read. Brown’s men must “peaceably surrender themselves” or else, for “it is impossible for them to escape.” The note was delivered by the future Confederate general J.E.B. Stuart, one of the officers present. And it was signed by the colonel in charge of the “U. S. Troops” surrounding Brown and his men.

The colonel’s name was Robert E. Lee.

As a historian of the Civil War era, I thought of that moment after seeing recent news reports about John Kelly. In an interview Monday night on Fox News, the White House chief of staff had described Lee, a slaveholder and secessionist, as an “honorable” man who “gave up his country to fight for his state.” Kelly contended that “150 years ago [fighting for one’s state] was more important” than supporting one’s country. “It was always loyalty to state first back in those days.”

Kelly’s comments reflect a widespread misunderstanding of the power of nationalism in the antebellum era and the ways that loyalty to nation, rather than to state, had served slaveholders’ interests before the war. The notion that state loyalty was “always” stronger is a popular, if simplistic, interpretation of the conflict’s roots—one that’s been reinforced by Hollywood films, monuments to the Confederacy, and documentaries like Ken Burns’s Civil War.

For example, popular portrayals have rarely captured how important the Union cause was to Northern soldiers, and they often depict Lee as a conflicted man who’s ultimately faithful to Virginia. This can lead many Americans to conclude that soldiers on both sides were fighting out of loyalty to their states—not in defense of deeper ideological principles like the preservation of the Union, on the one side, or slavery, on the other. But that assessment avoids reckoning with the actual history of men like Lee—and the history of the nation he proudly served before 1861.

That record shows loyalty to nation had long been important. A veteran of the Mexican-American War, Lee had no problem fighting for national glory 170 years ago. Nor did he see a conflict between national and state loyalty 158 years ago, when he suppressed the insurrection at Harpers Ferry upon the president’s orders.

The truth is that Lee and his fellow slaveholders were ardent nationalists in the decades leading up to the Civil War, as the Princeton historian Matthew Karp described in his recent book This Vast Southern Empire. And no wonder: For most of its history, the nation had usually protected and served the interests of slaveholders. For example, in 1850, the draconian Fugitive Slave Law—passed as part of an attempted “compromise” to reduce sectional conflict—ensured that the federal government would assist in the return of runaway slaves from the North to the South. By then, the U.S. Supreme Court had already overturned laws passed by Northern states that sought to interfere with the capture of fugitive slaves. And as the scene at Harpers Ferry showed, slaveholders relied on the potential power of the national government to assist in putting down insurrections in their states that might threaten the system of slavery.

Essentially, the nation worked for slaveholders, even to the point of overruling Northern states’ rights. Not surprisingly, those slaveholders were powerfully committed to the Union on whose power they depended. As long as the nation worked for them, they worked for the nation.

So what changed to make secessionists desert the country they loved? In brief: the rise of the Republican Party and the election of Abraham Lincoln, who refused to use national power to advance slavery any longer. At first glance, Lincoln and Lee may seem to have shared similar views on events like the Harpers Ferry raid. In 1859, Lee described Brown’s plan as “the attempt of a fanatic or madman, which could only end in failure.” A few months later, Lincoln likewise described Brown’s scheme as so “absurd” that even the slaves he sought to rally “saw plainly enough it could not succeed.” Brown was an “enthusiast,” Lincoln said, and he discouraged similar raids.

But at the same time, Lincoln didn’t promise federal help to quash future raids. Instead, he implied that abolitionists could do “by the peaceful channel of the ballot box” what Brown had attempted violently and on his own. Many in Lincoln’s party argued that the word “slavery” never appeared in the Constitution, and that the institution, where it existed, was protected only by state law.

Thus, despite Lincoln’s attempts to convince white Southerners that he still saw them as fellow Americans, slaveholders were not reassured. When Lincoln was elected in 1860, they began to rethink their national loyalty. Secessionists chose treason when they realized the country would no longer give them what they wanted. And as if that were not dishonorable enough, they cloaked their actions in rationalizations that appealed to Southern honor and loyalty to state.

Lincoln predicted these events in the 1860 speech distancing himself from Brown: “Your purpose,” he told Southern secessionists, was to “destroy the Government, unless you be allowed to construe and enforce the Constitution as you please, on all points in dispute between you and us. You will rule or ruin in all events.” Because their class could no longer “rule” under the government they’d long supported, Lee and his ilk chose “ruin” instead.

Kelly’s claims implied that Lee and other secessionists fought for the South because it was “always loyalty to state first back in those days.” But in reality, giving up on their country was a choice that secessionists made only after their long-lasting power to control the nation began to slip from their grasp.