Donald Trump was the most unpopular major party candidate in modern history, lost the popular vote to Hillary Clinton by nearly three millions ballots, and enters office on Friday as, by far, the most unpopular incoming president since record-keeping began. Meanwhile, he is inheriting an economy near full employment; a relatively stable international order; increasing wages, modest deficits, and record-low levels of uninsurance. It’s a fair bet that some of these metrics would deteriorate even under a serious-minded president, but the Trump-GOP policy agenda threatens to reverse several of them fairly quickly.

The question is whether, decades hence, Trump’s presidency will be remembered as an aberration that the country quickly corrects, or as a harbinger of a longer turn away from liberal democratic traditions and increasing tolerance. And this, in turn, will determine exactly how history remembers President Barack Obama.

Many bizarre factors contributed to Trump’s unlikely victory, but the one that should trouble Democrats most, is that across the country, and particularly in states Republicans needed to flip to carry the Electoral College, working-class whites responded to Trump’s racist campaign by voting in the same lopsided way that minority communities typically vote for Democrats. RealClearPolitics elections analyst Sean Trende told me in November that if what happened last year turns into a trend, Republicans are going to be winning national elections much more regularly than their demographic slide would have you believe. That may well include Trump in 2020. After all, most presidents get reelected—even bad ones, like George W. Bush, who also lost the popular vote 16 years ago.

A protracted Trump era would further divide whites and ethnic minorities; it would shift federal policy toward welfare chauvinism. Democratic norms would erode substantially; the playing field of elections would be tilted further, through the gutting of voting rights and other means, to delay the ascendance of a younger, more diverse electorate. Eventually, that electorate will rise, whether in four years or many more, the country will emerge from the Trump era and recognize it as an error. What we will face then—indeed, what we are already facing—is a battle for narrative control over why the country made that error in the first place. Was it a primal scream of race panic that, for a time, drowned out a silent majority? Or was it a backlash to the arrogance of Obama and his coalition?

It is widely assumed that Trump, at the head of a unified GOP government, will leave Obama’s legacy in rubble. This assumption rests on the twin premises that a president’s legacy is measured mostly by policy achievements, and that Republicans will have near-total success in beating back Obama’s. These premises are shaky, but not without merit. Obama wanted to be succeeded by a likeminded Democrat not just for the good of the country, or to preserve his legacy, but because he believed it to be an important validator of his claim to being a transformative president—a Democratic Reagan.