In March 1867, it had been nearly two years since the end of the Civil War—but the bloodshed was far from over. Massacres of African-Americans in southern states had continued unabated, and the federal government was locked in its own bloodless battles over how to repair a country split in two. But on March 2, 1867, Congress passed what historian Heather Richardson calls “one of the most important pieces of legislation in history”: the Military Reconstruction Act.

“The reason it’s a game-changer is because it divides the 10 southern states into five military districts, requires new state constitutional conventions to be written, and it’s the first time African-American men are given a blanket right to vote over a large area,” says Richardson, a professor at Boston College and author of The Death of Reconstruction. With the troops now mobilized in the former Confederacy, African-Americans’ rights could actually be protected.

But getting to the Reconstruction Act of 1867 was a long, painful slog. Just look at this cartoon by the renowned illustrator Thomas Nast from September 1866. The artist came to the United States from Germany when he was 6. Through his work for Harper’s Weekly and other major publications, he offered some of “the most strident arguments objecting to violence against African-Americans,” says Brooks Simpson, professor of history at Arizona State University. “The war was not concluded, it simply assumed a new stage.”

The precursor to violence in the early Reconstruction era was, of course, the Civil War itself and Abraham Lincoln’s assassination. Following Lincoln’s death, vice president Andrew Johnson ascended to the presidency in the spring of 1865. With Congress out of session, Johnson began implementing a version of Reconstruction consistent with his political ideologies as a Democrat from Tennessee, but counter to those of Lincoln and the Republicans. Johnson offered general amnesty to all southerners who took an oath of future loyalty, demanded that high-ranking Confederate officials petition him personally, and required the southern states to ratify the 13th amendment, abolishing slavery.

“He pardons all but about 1,500 of the leading Confederates,” Richardson says. “Those people who took the South out of the Union are now free and fair citizens again of the United States, less than a year after the end of the war.” The move infuriated northern Republicans, who rallied behind the message depicted in Nast’s cartoon, which Richardson describes as, “don’t put Johnson’s people in office because he’s going to give us back the world we had before the Civil War.”

Left to manage their own affairs, many of the former Confederate states passed Black Codes that stripped African-Americans of almost all rights and essentially returned them to a forced labor system. Republican legislators were appalled when they returned to Congress in December 1865, and immediately tousled with Johnson for the future of the country. “They’re worried about not fully solving the slavery problem and letting it fester, and that might cause instability and even civil war again in the future,” Benedict says.

The Republican majority tried to pass both a Civil Rights bill and an extension of the Freedman’s Bureau, both of which were aimed at giving African-Americans the rights to property, contracts and legal access that white male Americans took for granted. But Johnson vetoed both, further angering the Republicans. Then came massacres in Memphis and New Orleans in the summer of 1866, resulting in the deaths of dozens of African-Americans. Republicans began arguing that they needed a military presence in the South to protect the newly made citizens.

Leading up to the 1866 legislative elections, Nast harnessed the broad readership of Harper’s Weekly to skewer Johnson’s policies and convince voters to elect Republicans. In his political cartoons, he repeatedly framed Johnson as a danger to the country and to African-Americans, despite Johnson arguing to the contrary.

In an attempt to prevent a Republican supermajority, the president attacked the Republicans’ Reconstruction plan as overly costly, and disadvantaging white Americans by giving African-Americans more rights. He played on the racism that even northerners held. “Johnson argues that Republicans in Congress are planning to use tax dollars to give advantages to African-Americans that whites don’t have, by keeping the military in the south after the Civil War. Therefore it is a redistribution of wealth from hardworking white people to lazy African-Americans,” Richardson says.

“What was at stake was the kind of nation the U.S. was going to be,” says historian Michael Les Benedict. “We had been a slave republic. Not a free republic. What kind of republic was going to emerge? A republic dedicated to freedom and equality? Or a racist republic, one in which African-Americans had a place subservient to whites?”

In the late fall of 1866 (dates varied from state to state), elections were held for the Senate and House of Representatives. Republicans won a supermajority, and with their numbers were able to pass the Military Reconstruction Act. A number of Reconstruction Acts continued to be passed, forcing the southern states to ratify the 14th Amendment (which provided citizenship rights and equal protection by law to African-Americans). Johnson continued to work against Congress, encouraging southern states to reject the 14th Amendment. Ultimately the legislators grew frustrated enough to vote to impeach him, making him the first U.S. president to be impeached—though he did serve out the rest of his term. Reconstruction survived until 1877, when President Hayes withdrew the last federal troops from the South.

To learn more about the issues in 1866 and how Nast used symbolism to capture them, click through the document above.