In the beginning, there was San Bernardino.

Up until December 2015, Donald Trump's presidential campaign looked to most Americans like a boredom-alleviating diversion for an aging and affluent playboy. Then Syed Rizwan Farook and Tashfeen Malik, a married couple, murdered 14 people at an office Christmas party in San Bernardino, California. It was the hot wind behind the brush fire of the Trump campaign — he soon called for his infamous Muslim ban — and the nation was plunged into furious debates about border walls, terrorism, and birth tourism.

Now, in his last push for midterm votes, President Trump has returned to this favorite theme, deploying thousands of troops to the southern border to save us from an "invasion" of unarmed and footsore Central American migrants.

In a grim way, this is fitting. Trump's demagogic genius has always turned on paranoid crusades against imagined enemies: ethnic minorities, feminists, the press, bureaucrats, Democrats, "establishment" conservatives. But invading aliens still seem to be among the most potent of Trump's dystopian phantasms. Mexico wouldn't pay for a wall, and now the Hondurans are coming for us.

Nativism is ugly. But this isn't the first time America has seen it. And the good news is that it can be relatively fleeting.

Taming the nativist demon is a twofold process. Ugly prejudices must be identified and condemned. At the same time, it's important to transcend xenophobic rhetoric with a more humane and uplifting message that appeals to a shared national identity. Nativism arises when a subset of citizens feel alienated from their own society. To subdue it, we must appeal not only to our compatriots' sense of decency, but also to their honor as fellow Americans.

Throughout our nation's history, successive waves of newly arrived immigrants encountered resentment and prejudice, especially from less-prosperous native inhabitants. The Irish and Poles were alarmingly Catholic, while the Chinese were stereotyped as a dim-witted race suited only for physical labor. Italian Americans spent decades fighting the perception that they were naturally superstitious and prone to criminality. In the 1910s, the Ku Klux Klan allied with the suffragettes to support Prohibition, in part because they resented the success of German immigrants in founding successful breweries.

The Native American Party, better known as the "Know-Nothings," emerged in the mid-1840s in response to large influxes of Catholic immigrants. In the fall of 1854 this movement looked unstoppable. Nativism was all the rage, storming legislatures throughout the Northeast and stamping its "Know-Nothing" brand on candy and other popular products. Within the next three years though, the party became completely defunct, splintering over its own extremist views and a dearth of responsible leadership. Abraham Lincoln (who had quietly abhorred the Know-Nothings from the start) offered a more elevated message for anti-slavery whites who yearned for national unity. The Know-Nothings were mostly subsumed into the newly forged Republican Party, and their nativism receded into the background.

These were not proud moments in our nation's history, but they didn't lead to widespread outbreaks of genocidal violence. In relatively short order, the descendants of once-scorned immigrant groups proved their social worth and became thriving members of the American mainstream. Blacks and indigenous Americans are exceptional here, as groups that have been seriously and systematically oppressed across extended periods of American history. Unsurprisingly, we continue to wrestle with that sad legacy. In most other cases though, old grievances have dissipated as we move on to new frontiers, new scientific breakthroughs, new economic advances, and new cultural movements.

Given this history, it's interesting that so many educated liberals view present social tensions with a disconsolate dread, seeing them as a looming existential threat that may destroy our whole society. Though I readily grant that nativist grievance-mongering is offensive, I would ask: Is there much reason to think that things are uniquely bad? Many of our citizens feel alienated from mainstream society. That leaves them lamentably susceptible to nativist appeals. Trump, unfortunately, is uncontrollable, but history still suggests that Americans have the resources to overcome these kinds of challenges. Prejudice fades, or at least it can, if people of goodwill choose Lincoln's path, crafting an uplifting message that may awaken better angels.

Do educated Americans still have the capacity to speak that language? There's reason to doubt it. In recent decades, universities and elite professions have increasingly adopted a cosmopolitan and globalist outlook, to the point where many in these milieus report that they are actively ashamed of being American. To be sure, there are reasons to celebrate cosmopolitanism; it can encourage curiosity, open-mindedness, and a spirit of cooperation, all of which are sorely needed in our ever-shrinking world. At the same time, it's important to recognize that cosmopolitanism will always be most appealing to people of education and means, who already feel well-connected and secure. For people who are lonely, underemployed, or otherwise struggling, citizenship feels like an important personal asset. They need to be reassured that their membership in American society means something, to their compatriots and especially to their leaders. If that sense of shared citizenship is lacking, nativist demagogues will easily find an audience.

Nativism will not be tamed by endless diatribes against prejudice, far less by bitter denunciations of "deplorables." What may really help are reminders of those aspects of American tradition that have truly made us great: a generous spirit, a restless eagerness to discover and innovate, and a willingness to live in company with people of diverse backgrounds and creeds. No nation in modern history has been quite so successful at embodying the spirit of e pluribus unum, joining our diverse strengths to forge one peaceful and free society. We need to relearn that habit.

I can't discern much of that generous American spirit among the Trumpian intelligentsia, who seem fixated on American exceptionalism to the point of becoming paranoid and insular. Among liberals, I see a different problem: a curious reluctance (or inability) to articulate what's distinctively American about the future they envision for these United States. To many highly educated Americans, that may just not seem very important. But it's important to their compatriots, so they need to remember how to speak American.

This nation is better than its president. It's better than the rancorous partisan squabbles that have lately come to define our politics. To move forward, we'll also need to look back, finding unity in a shared history that is both demanding, and forgiving. We should feel proud to be Americans. That's what will make us eager to ensure that our children can share that same pride.