At the age of nineteen, Abraham Lincoln made the grand tour of the West, as it existed then and as his means allowed. He traveled as a flatboat deckhand down the Mississippi River to New Orleans. Feeling the power of the great river, and observing the armada of boats and barges bringing produce, lumber, minerals, and other goods from the far reaches of the Mississippi Valley, he understood how central the West was to America’s present and future.

A quarter century later, as a Springfield lawyer of some reputation and a politician of unfulfilled ambition, Lincoln read of the struggle in Kansas and thought, once more, that as the West went, so the country would go. Lincoln’s single term in Congress, as a Whig, hadn’t led to anything more in the political field by the time the Whigs disintegrated in the early 1850s. Lincoln joined the new Republican party, along with many former Whigs and Free Soilers. He scored points for the party and for himself by criticizing Stephen Douglas on the Kansas-Nebraska Act. Being a man of peace and a moderate among the opponents of slavery, he shuddered at the news of the Pottawatomie massacre and watched with concern as the violence in Kansas escalated.

Lincoln grew alarmed when the Supreme Court in 1857 handed down a decision that threw nearly the whole West open to slavery. In the Dred Scott case, the court decreed that Congress had no power to prevent slaveholders from taking their slaves into the Western territories. The Missouri Compromise had been unconstitutional all along. By this decision, the court cut the ground from under Republican moderates who, while granting that the Constitution protected slavery in the states where it existed, held that Congress could, and must, keep slavery out of the Western territories. The Dred Scott verdict killed this option.

But it revitalized Lincoln’s career. In 1858 he challenged Stephen Douglas for the Senate seat Douglas held. In a series of debates that summer, the two tramped up and down Illinois, with Lincoln on the attack against the Dred Scott decision, as well as the Kansas-Nebraska Act and other parts of the Douglas record. Lincoln didn’t win the election; Douglas was returned to office. But the effort gained Lincoln a name among Republicans. He was thoughtful and articulate. He was determined to keep slavery out of the West. And at a time of rising voices all across the country, he understood how to make his points without making a fuss. He was moderate not merely in views but in temperament and manner. The experienced political hands among the Republicans took note especially of this. Their reading of the electoral college convinced them that the Republican nominee in 1860, if he didn’t scare away moderates in the North, had an excellent chance of becoming the next president. Lincoln might be their man.

The value of moderation increased in 1859, when the slavery debate took another violent turn. Though wanted for murder in Kansas, John Brown traveled freely around the North, albeit under assumed names. Abolitionists shielded him and gave him money, and he plotted a blow against slavery more telling than the murder of a handful of slavery men. He projected an insurrection of slaves in Virginia that would spread across the South and lead to the overthrow of the slave system.

His first step was the seizure of the federal arsenal at Harpers Ferry, Virginia. Brown and his followers entered the town at night in October 1859. Meeting little resistance, they occupied the arsenal and made prisoners of its guards. Meanwhile other Brown men moved quietly about the neighborhood spreading word to slaves that freedom was at hand. The slaves should come to Harpers Ferry, where they would receive weapons and instructions for their war of liberation.

The slaves rejected Brown’s plan. They wanted nothing to do with him or his war. Some were less unhappy with their lot than Brown had supposed; others simply reckoned that his plan was crazy and would only get them killed. Awaiting reinforcements that never appeared, Brown and his men became trapped in the arsenal by local authorities who quickly summoned militia. Regular marines arrived from Washington by train, commanded by U.S. army colonel Robert E. Lee. After Brown refused to surrender, Lee ordered the storming of the engine house where Brown and the others were holed up. Several of Brown’s men were killed; Brown himself was wounded but taken alive.

Virginia prosecutors charged him with treason against the commonwealth. Brown was tried, convicted, and sentenced to hang. But before his execution he was allowed to speak, and his eloquence in indicting the slave system seared the consciences of Northern abolitionists who asked themselves why they hadn’t had the courage to put their lives on the line for their beliefs, as Brown had done. Brown’s death was observed by the tolling of church bells in the North and his canonization by many Northerners as a martyr to liberty.

The South was appalled by every part of this. A race war had been the nightmare of the white South for decades; Brown’s raid on Harpers Ferry rendered the nightmare chillingly plausible. And then, when the North made a saint of this terrorist, Southerners despaired that they could ever be safe within the Union. Abraham Lincoln distanced himself from John Brown. He sincerely disagreed with Brown’s violent approach. But Lincoln also recognized that the path to the presidency for a moderate Republican required keeping clear of a militant like Brown. John Brown was no Republican, Lincoln told all who would listen, including a crowd at the Cooper Institute in New York, to which Lincoln had been invited by fellow Republican moderates. The crowd sized up Lincoln as a possible nominee for president, and most liked what they saw and heard. Lincoln passed subsequent tests on his way to the Republican national convention, where he got the nod of the party.

The election was divisive but the outcome foreordained. Lincoln didn’t have to win a single electoral vote in the South in order to carry the election. He didn’t, and he did. Even before his inauguration, Southern states began to secede: first South Carolina, then six more. The last two of the seven—Louisiana and Texas—were crucial. Had secession been limited to states east of the Mississippi, many Northerners, conceivably including Lincoln, might have been tempted to let them go. They would never be more than a rump country on the wrong side of history, weighed down by slavery while the rest of the civilized world, under the double inspiration of democracy and industrialization, was abandoning the feudal institution.

But when secession leaped the Mississippi, it put Lincoln in the position Benjamin Franklin and Thomas Jefferson had been in when they rejected the idea that any part of the great river could be in foreign hands. Most goods and cargoes continued to travel by water; the Mississippi still held the key to the American West. Franklin hadn’t been willing for Britain or Spain to threaten access to the West; Jefferson wouldn’t suffer France to do the same thing. Now Lincoln refused to let the Confederacy endanger the West and jeopardize America’s future.

The war came. And though it brought tremendous trials to the North and the South, it conferred great good fortune on the West. Westerners fought in the war: most Texans on the Confederate side, and nearly all other Westerners with the Union. But very little fighting took place in the West. And the politics of the Civil War served Western interests quite well. More precisely, the politics of the war served particular Western interests. Secession and the war enabled a revolution in American policy toward the ownership of Western land.

Southern secession made the Republicans the dominant force in national affairs, and in 1862 the Republican-controlled Congress passed the Homestead Act, which authorized every head of family or single adult to receive 160 acres of federal land for free, providing that he or she—women were included—lived on the land for five years and improved it. Transferrable title could be acquired sooner, after one year, by the payment of $1.25 per acre. The law applied to American citizens and to immigrants who had declared an intention to become citizens.

The effective date of the Homestead Act was January 1, 1863, which not coincidentally was the day the Emancipation Proclamation was issued. And just as the Emancipation Proclamation promised to revolutionize life in the South, the Homestead Act appeared certain to revolutionize life in the West. “We cannot but feel that the passage of the Homestead Bill will form a new era in Western emigration,” declared the Kansas Junction Union, in a sentiment echoed in a hundred Western papers. “The field is now fully open to the honest and energetic farmer, who wishes to secure himself a home on easy terms.”

Excerpted from Dreams of El Dorado: A History of the American West by H.W. Brands. Copyright © 2019 by H.W. Brands. Available from Basic Books.