As Americans prepare to vote in the midterm election Tuesday, we also mark the 50th anniversary of the 1968 election. For many Americans who lived through it, the 1968 election represents nothing less than the “transformation of American politics,” if not a “war for America’s soul.” The importance of Richard M. Nixon’s victory — and Hubert Humphrey’s defeat — is often judged by what followed: the decline of liberalism, a dominant Republican majority, a resurgent and powerful conservative movement, and a polarized, divided nation.

But the 1968 election also was the culmination, not just the catalyst, of forces that remade the United States 50 years ago — and similar ones are working to realign American politics again in 2018. Indeed, the history of the 1968 election suggests that President Trump and his Republican base are at the beginning of their end. American elections are products of historical forces in motion, ones that upend political norms well before Americans head to the ballot box. If history is a guide, Democrats will show this on Tuesday, in the “most important election of our lifetime.”

American politics in 1968 was convulsive, nearly chaotic. Even in January, Americans felt as though the country was in the throes of “a national nervous breakdown … a depression of the national spirit.” The year began with the Tet Offensive in Vietnam, which undermined the Johnson administration’s claims that the war was nearly over, and was followed by the assassinations of the Rev. Martin Luther King Jr. in April and Robert F. Kennedy in June. The nation unraveled amid urban riots and mounting protests against the Vietnam War, and a president, Lyndon B. Johnson, who declined to seek another term because of that war.

Then came the Democratic National Convention in August, during which antiwar demonstrators, students and activists clashed with police in the streets of Chicago. Humphrey became the Democratic nominee despite the violence at the convention and the unpopularity of the war (which he publicly championed but privately criticized). Meanwhile, Alabama Democrat George Wallace, running as an independent, toured the country making demagogic and racially coded — if not overtly racist — appeals to “law and order” and “states’ rights.” Nixon, the Republican, appeared to be the steady alternative to the status quo (Humphrey) and the extreme (Wallace), the man who spoke of “peace with honor” in Vietnam and of the Democrats’ “failures” to confront the twin epidemics of crime and unemployment.

Given the divisions within the Democratic Party and the country — on race, Vietnam and the role of government — Nixon’s victory was predictable, but his slim margin of victory (just over 500,000 popular votes) still stunned the country.

What made Nixon’s win more surprising was that four years earlier, few saw it coming. In 1964, Johnson, who had been sworn in as president after John F. Kennedy was assassinated in 1963, was elected with the largest number of electoral college votes in American history. Johnson’s promise of a “Great Society” defeated Barry Goldwater in all but six states, and liberalism’s future appeared bright and endless. New York Times columnist James Reston even predicted that Goldwater “has wrecked his party for a long time to come.”

But those predictions proved false, offering a reminder of how quickly politics can shift. Nixon himself embodied this principle: He restored the GOP to power in 1968, only a few years after losing the 1960 presidential election to Kennedy and the California governor’s race in 1962. (That the “revolutionary 1960s” resurrected Nixon’s political career is surely one of the decade’s ironies.)

Nixon revealed the fragility of Johnson’s victory in 1964, how it was more aberration than reality. Nixon also profited from the riots, protests and wars of the 1960s — the obvious signs that the nation was ripe for change. But demographics helped Nixon, too. Throughout the 1960s, deindustrialization displaced blue-collar factory work for white-collar jobs, while white flight from cities and the suburbanization of the Sun Belt South gave Nixon opportunities to peel voters from the Democratic coalition.

Seismic shifts in American politics, identity and culture also laid the groundwork for the election. As baby boomers became eligible to vote, movements for civil rights and women’s rights made inroads into the nation’s long-standing racism and sexism, while the Vietnam War challenged Cold War perceptions of the United States as a defender of freedom and democracy abroad. These rapid, massive changes ignited a fierce backlash that boosted Nixon. By 1968, a new generation was born: a generation disillusioned with the country’s past and cynical about its future, yet one that also yearned for the economic boom that followed World War II, for a lost prosperity.

In many ways, the United States is looking eerily like it did in the months and years before the 1968 election. Accepted truths are being tossed aside: Socialism is growing in popularity, especially among young Americans, and free-market capitalism is regularly under attack. The United States is seeing a racial backlash similar to that of 1968, one hastened by a demographic divide.

As the country undergoes weekly, if not daily, crises under Trump — who, like Wallace, favors bombastic “us versus them” rhetoric — movements for greater equality and justice such as #MeToo and Black Lives Matter have exposed the progress unfulfilled since 1968. And although Vietnam discredited the policy of containment, the wars in Iraq and Afghanistan, combined with a revival of American nationalism (“America First”) unseen since World War II, have generated a revolt against the entire liberal world order.

Just as Goldwater’s supporters were emboldened by his defeat to enter politics and political activism, acolytes of Sen. Bernie Sanders (I-Vt.) have channeled their dismay about the 2016 presidential election into support for a host of left-leaning candidates. Many of these young Americans have discovered politics for the first time, upset that the Democratic Party has once again atrophied while Trump and the Republicans weaponize nostalgia at the ballot box.

As it did for Democrats in 1968, the state of American politics spells disaster for Republicans. Like Johnson in 1964, Trump has amassed a powerful, but ultimately precarious, coalition, one that is coming undone under his leadership. The 2018 midterm election will not defeat Trump, but as the 1968 election did to Democrats, it is sure to poke holes in the Republicans’ majority. If nothing else, the election will prove that Americans want a change — a turn away from the inadequacies of the present.

The election also will be a referendum on the past two years, on the state of our democracy. For above all, the 1968 election held a mirror to the country and reflected what we had become. Tuesday’s election is expected to do the same. We can only hope to like what we see.