But President Trump’s wall-building, great-again nationalism is reviving the old Mexican version, too. His characterization of tougher border enforcement and immigration raids as “a military operation” hit the nerve that runs through this legacy, undermining his aides’ trip to Mexico City this week and the message that relations with the United States remain strong.

Instead, the public outrage at Trump has sunk those relations to their lowest point in decades. It has inspired a campaign to boycott U.S. chains such as Starbucks and buy “Made in Mexico” products. Protesters marched in a dozen cities this month, carrying grotesque effigies of the American president. And Trump’s taunts have buoyed the poll numbers of 2018 presidential contender Andrés Manuel López Obrador, the left-wing populist Mexicans see as the figure most likely to fight back.

For Mexicans, the problem is not merely the wall. They know their country is poorer, more violent and less law-abiding than the United States. If Trump had announced plans for tougher border security, many Mexicans would have understood, even as they criticized him.

But when they hear Trump boasting he will make Mexico pay for the wall, and the wild cheering in response, they recognize an unmistakable attempt to humiliate them. It is American nationalism at Mexico’s expense, and it stings in a deep, atavistic way, like a childhood bully coming back to beat you up again.