How has Donald Trump greeted this surge of anti-American nationalism? By stoking it even more. In a tweet Saturday, he threatened to destroy “sites … important to Iran & the Iranian culture”—places, presumably, that symbolize not just the Islamic Republic but Persian civilization. In addition, he’s answered the Iraqi government’s call for American forces to leave by demanding that Baghdad “pay us back” for the “extraordinarily expensive air base” America built there, and by threatening sanctions against Iraq that will “make Iranian sanctions look somewhat tame.”

Rasha Al Aqeedi: The world paid attention to the wrong Iraqi protests

For any president to so recklessly foment anti-American nationalism would be remarkable. But that Trump is doing so is particularly ironic. No other president in modern American history has made nationalism as central to his political identity. None has so loudly and unambiguously celebrated it on the international stage. How can a president so attuned to nationalism’s power at home ignore its power in Iran and Iraq? The answer, as with so much about Trump, involves religion and race. Trump respects—and even reveres—nationalism in countries he views as Western and white. But he derides and dismisses it almost everywhere else.

To understand why, it’s necessary to understand the foreign-policy tradition that best captures Trump’s thinking: that of Andrew Jackson. Given Trump’s impulsivity and ignorance, discerning any ideological basis to his behavior might seem far-fetched. But as Walter Russell Mead—who first argued that Jackson had birthed a distinct school of American foreign policy—has explained, Jacksonianism is less a doctrine than a set of impulses and instincts. And Trump embodies them far better than any other contemporary American politician.

In his 1999 book, Special Providence, Mead notes that “Jacksonians recognize two kinds of enemy … honorable enemies fight a clean fight and are entitled to be opposed in the same way; dishonorable enemies fight dirty wars and in that case rules don’t apply.” The template for each was formed early in American history: The quintessential honorable enemy was Britain, whose soldiers wore uniforms, marched in formation, and—most important—shared the race and religion of the men who ran the nascent United States. The quintessential dishonorable enemies were Native Americans, whom Jackson brutally displaced.

In the centuries since, this racialized distinction has shaped the way America fights. The tendency of white Americans to see the Japanese as “ruthless, dishonorable and inhuman,” Mead notes, contributed to the “vitriolic intensity” of America’s war in the Pacific. By contrast, the German army during World War II “won a measure of respect from the Americans”—despite its horrifying crimes—because it acted “more in accordance with American ideas about military honor” and, not coincidentally, because its members were mostly Christian and white.