Last summer, Donald Trump described Mexican immigrants as “bringing drugs, they’re bringing crime. They’re rapists.” In December, he called for “a total and complete shutdown of Muslims entering the United States.” Many commentators claim that this wild rhetoric helps Trump suck up media oxygen or appear like a straight-talking political outsider. But the most important benefit of the anti-immigrant language is that it inoculates Trump against the charge of being a closet liberal.

Trump has a seemingly fatal vulnerability in the Republican primary: His past support for a host of moderate and liberal positions. In recent years, Trump said he would “press for universal health care,” claimed that he was “pro-choice in every respect,” remarked that “I hate the concept of guns,” stated that Hillary Clinton would “do a good job” in negotiating with Iran, asserted that the GOP was “just too crazy right,” and even said, “In many cases, I probably identify more as a Democrat.”

The problem for Trump is that he’s running for the nomination of a party in no mood for compromise. The rise of the Tea Party pushed the GOP to the right. There is an entire lexicon devoted to condemning Republican moderates: “squish,” “Republicans in name only” (RINOs), “milquetoast,” or, of course, “establishment Republicans.” GOP candidates are routinely assailed for deviating from conservative orthodoxy, including Mitt Romney’s backing “Romneycare” as governor of Massachusetts, Senator Marco Rubio’s past support for immigration reform, or Ohio Governor John Kasich’s expansion of Medicaid.

A 2013 poll found that most Republicans wanted a congressman who “sticks to their principles no matter what,” over someone who “compromises to get things done.” By contrast, large majorities of Democrats and Independents preferred someone who would bargain with the opposition. Similarly, last October, a poll found that 62 percent of Republicans wanted leaders who refuse to compromise on principle even if it risked a government shutdown, whereas more than three-quarters of Democrats favored cutting deals with the GOP to avoid gridlock.

One of the great puzzles of the primary season is why a candidate who so recently espoused moderate or progressive views is succeeding in a party that favors purity over pragmatism. Of course, Trump can always claim that he had a road-to-Damascus-style conversion to conservatism. But this claim surely won’t cut it for many movement conservatives. After all, if Trump can flip to the right so recently, perhaps he’ll flop back to the left in due course.

For Trump, the solution has been to announce something so outrageously offensive to liberals, so contrary to every progressive shibboleth, that its utterance immediately disqualifies him from being a leftist. Opposing Obamacare isn’t good enough. After all, some progressives aren’t big fans of the Affordable Care Act. Neither is it sufficient to back gun rights. Many on the left own guns and believe in the Second Amendment. In any case, these are issues on which reasonable people can disagree. What Trump needs is something that is literally unspeakable for a liberal. Trump’s immigration policy is just the ticket. Virtually no progressive would dream of banning the world’s 1.6 billion Muslims from visiting the United States. The very idea represents a kind of exclusionary nativism that is anathema to liberals. Trump’s anti-immigrant language is an efficient way of proving that he has abandoned the left. In a single glorious moment of illiberal demagoguery, he can achieve what would otherwise take months of debate and rebuttal.

The proposal to ban Muslims is certainly popular among Republicans: Almost six in ten GOP voters support it. More importantly, the issue establishes an emotional connection with primary voters who feel that Trump is on their side. Emotion is the most powerful force in politics, and it is often far more compelling than arguments based on facts and reason. Once Republican voters identify with Trump, it unleashes what psychologists call “cognitive consistency.” People will rearrange their beliefs to produce an unswervingly positive view of the candidate. Even crystal-clear evidence of Trump’s past liberalism will be ignored or rationalized away. Whereas a single deviation from conservative orthodoxy can sink many GOP candidates, Trump supporters just don’t seem to care about his previous widespread embrace of moderate ideas.

The anti-immigrant language is therefore central to Trump’s political rise and to his victory in New Hampshire. Strip it away and Trump would be widely criticized as a conservative in name only. The rest of the Trumparama—the outsider status, the billionaire businessman, the razzmatazz—probably wouldn’t be enough for a party eager for a principled warrior. By contrast, for someone like Senator Ted Cruz, extreme anti-immigrant rhetoric is far less useful. Cruz doesn’t need a shield against the charge of liberalism because few doubt his conservative credentials.

What Trump has discovered is that, to win the GOP nomination, it’s not enough to attack the Democrats. He must speak the unspeakable.