America today is caught in a plague of gun violence. It wasn’t always this way. Americans used to own guns without engaging in daily massacres.

Indeed, it always jumps out at me that the infamous St. Valentine’s Day Massacre of 1929, when members of one Chicago gang set up and killed seven members of a rival gang, was so shocking it led to legislation that prohibits automatic weapons in the U.S.

Eighty-nine years later, though, in 2018, another Valentine’s Day shooting at Marjory Stoneman Douglas High School in Parkland, Florida, killed 17 children and wounded 17 others. In response, then-President Donald Trump called for arming teachers, and the Republican-dominated Florida legislature rejected a bill that would have limited some high-capacity guns.

Our acceptance of violence today stands in striking contrast to Americans’ horror at the 1929 Valentine’s Day Massacre.

Today’s promotion of a certain kind of gun ownership has roots in the politics of the country since the Supreme Court handed down the 1954 Brown v. Board of Education of Topeka, Kansas, decision, which declared racial segregation in public schools unconstitutional. Since Democratic President Franklin Delano Roosevelt instituted a government that actively shaped the economy, businessmen who hated government regulation tried to rally opposition to get rid of that government. But Americans of the post-World War II years actually liked regulation of the runaway capitalism they blamed for the Great Depression.

The Brown v. Board decision changed the equation. It enabled those who opposed business regulation to reach back to a racist trope from the nation’s Reconstruction years after the Civil War. They argued that the active government after World War II was not simply regulating business. More important, they said, it was using tax dollars levied on hardworking white men to promote civil rights for undeserving Black people. The troops President Dwight Eisenhower sent to Little Rock Central High School in 1957, for example, didn’t come cheap. Civil Rights, then, promoted by the newly active federal government, were virtually socialism.

This argument had sharp teeth in the 1950s, as Americans recoiled from the growing influence of the U.S.S.R., but it came originally from the Reconstruction era. Then, white supremacist southerners who were determined to stop the federal government from enforcing Black rights argued that they were upset about Black participation in society not because of race—although of course they were—but rather because poor Black voters were electing lawmakers who were using white people’s tax dollars to lay roads, for example, or build schools.

In contrast to this apparent socialism, southern Democrats after the Civil War lionized the American cowboy, whom they mythologized as a white man (in fact, a third of the cowboys were men of color) who wanted nothing of the government but to be left alone (in reality, the cattle industry depended on the government). Out there on the western plains, the mythological cowboy worked hard for a day’s pay for moving cattle to a railhead, all the while fighting off Indigenous Americans, Mexicans, and rustlers who were trying to stop him.

That same mythological cowboy appeared in the 1950s to stand against what those opposed to business regulation and civil rights saw as the creeping socialism of their era. By 1959, there were 26 Westerns on TV, and in March 1959, eight of one week’s top shows were Westerns. They showed hardworking cowboys protecting their land from evildoers. The cowboys didn’t need help from their government; they made their own law with a gun.

In 1958, Republican Senator Barry Goldwater of Arizona rocketed to prominence after he accused the president from his own party, Dwight Eisenhower, of embracing “the siren song of socialism.” Goldwater had come from a wealthy background after his family cashed in on the boom of federal money flowing to Arizona dam construction, but he presented himself to the media as a cowboy, telling stories of how his family had come to Arizona when “[t]here was no federal welfare system, no federally mandated employment insurance, no federal agency to monitor the purity of the air, the food we ate, or the water we drank,” and that “[e]verything that was done, we did it ourselves.” Goldwater opposed the Brown v. Board decision and Eisenhower’s decision to use troops to desegregate Little Rock Central High School.

Increasingly, those determined to destroy the postwar government emphasized the hardworking individual under siege by a large, grasping government that redistributed wealth to the undeserving, usually people of color. A big fan of Goldwater, Ronald Reagan famously developed a cowboy image even as he repeatedly warned of the “welfare queen” who lived large on government benefits she stole.

As late as 1968, the National Rifle Association supported some forms of gun control, but that changed in the 1980s as the organization affiliated itself with Reagan’s Republican Party. In 1981, an assassin attempted to kill the president and succeeded in badly wounding him, as well as injuring the president’s press secretary, James Brady, and two others. Despite pressure to limit gun ownership, in 1986, under pressure from the NRA, the Republican Congress did the opposite: it passed the Firearms Owners’ Protection Act, which erased many of the earlier controls on gun ownership, making it easier to buy, sell, and transport guns across state lines.

In 1987, Congress began to consider the Brady Handgun Violence Prevention Act, otherwise known as the Brady Bill, to require background checks before gun purchases and to prevent certain transfer of guns across state lines. As soon as the measure was proposed, the NRA shifted into high gear to prevent its passage. The bill did not pass until 1993, under President Bill Clinton’s administration. The NRA set out to challenge the law in the courts.

While the challenges wound their way upward, the idea of individuals standing against a dangerous government became central to the Republican Party. By the 1990s, men increasingly vowed to take up arms against the government that talk radio hosts told them was bringing socialism to America. After April 19, 1993, when federal officers stormed the compound of a religious cult whose former members reported that their leader, David Koresh, was stockpiling weapons, talk radio hosts like Rush Limbaugh and Alex Jones warned that the government was about to impose martial law. Angry opponents of the government began to organize as well-armed “militias.”

In 1997, the NRA’s challenges to the Brady Bill had made their way to the United States Supreme Court. Printz v. United States brought together the idea of unfettered gun ownership and Republican government. The court held that it was unconstitutional for the federal government to require states to perform background checks. This both freed up gun purchases and endorsed states’ rights, the principle at the heart of the Republican policy of dismantling the active government that regulates business and protects civil rights.

We are in a bizarre moment, as Republican lawmakers defend largely unlimited gun ownership even as recent polls show that 84% of voters, including 77% of Republicans, support background checks. The link between guns, cowboys, race, and government in America during Reconstruction, and again after the Brown v. Board decision, helps to explain why.

Letters from an Аmerican is a daily email newsletter written by Heather Cox Richardson, about the history behind today’s politics