Pundits are pretty sure that Donald Trump has “jumped the shark.” “Mr. Trump’s candidacy probably reached an inflection point on Saturday after he essentially criticized John McCain for being captured during the Vietnam War,” declared The New York Times’ Nate Cohn last weekend. “Republican campaigns and elites quickly moved to condemn his comments—a shift that will probably mark the moment when Trump’s candidacy went from boom to bust.”

If Cohn is right, and I certainly hope he is, Trump’s political career will have followed the same basic arc as that of another notorious American demagogue, Joseph McCarthy.

Consider the parallels. First, McCarthy, like Trump, was an opportunist, not a zealot. Although the Wisconsin senator later grew famous hunting communists, communists in the Milwaukee branch of the Congress of Industrial Organizations played a key role in his initial Senate victory in 1946. In his first three years in the Senate, McCarthy hunted for an issue on which to make his name. He considered proposing a national pension plan or championing the St. Lawrence Seaway. But by 1950, the U.S.S.R. had tested an atomic weapon, communists had won China’s civil war, and alleged Soviet spy Alger Hiss had been convicted of perjury. Midwesterners, long suspicious of the East Coast’s foreign-policy class, and Catholics, bitter over Moscow’s domination of their co-religionists in Eastern Europe, were particularly receptive to claims that Washington elites had sold out America to the U.S.S.R. So in February 1950, McCarthy began loudly exploiting those grievances, famously declaring in Wheeling, West Virginia, that “I have here in my hand a list of 205 [communists] working and shaping policy in the State Department.”

In his search for scapegoats, Trump has proved ideologically flexible too. In 1988, when he first publicly mulled a presidential campaign, the scapegoat du jour was Japan, whose economy appeared to be overtaking America’s. “The Japanese, when they negotiate with us, they have long faces,” Trump told a New Hampshire crowd in 1987. “But when the negotiations are over, it is my belief—I’ve never seen this—they laugh like hell.” His suggestion: “Whatever Japan wants, do the opposite.”

When Trump flirted with a presidential campaign again, in 2000, he played the centrist. He was leaving the GOP for Ross Perot’s Reform Party, he announced, because “the Republicans are just too crazy right.” He even attacked his likely Reform Party opponent, Pat Buchanan, for being anti-black.

In the Obama era, however, Trump has discovered the power of racial and ethnic grievances himself. As early as 2007, when Obama began running for president, pollster Mark Penn sent Hillary Clinton a memo declaring that Obama was “not at his center fundamentally American in his thinking and values.” Obama critics relentlessly questioned his connection to, and love of, the United States. Polls showed that a plurality of Republicans believed Obama was not born in the United States.

Like McCarthy during the red scare, Trump saw his opening. “I have people that have been studying [Obama’s birth certificate] and they cannot believe what they’re finding,” Trump declared in 2011. “If he wasn’t born in this country, which is a real possibility…then he has pulled one of the great cons in the history of politics.” Trump also implied that Obama was a beneficiary of affirmative action. “I heard he was a terrible student, terrible,” the real estate mogul mused. “How does a bad student go to Columbia and then to Harvard? I’m thinking about it, I’m certainly looking into it. Let him show his records.”

If McCarthy and Trump are similarly opportunistic, their party’s initial response to them was similarly craven. In 1950, McCarthy focused his attacks on progressives who had prior associations with communist front groups, diplomats who had counseled the United States to accept the inevitability of a communist victory in China, and gay men, who McCarthy claimed were at risk of Soviet blackmail. And while a few Republicans, like Maine’s Margaret Chase Smith, denounced McCarthy, his popularity scared most of them into silence. (It scared some Democrats too. The Kennedy family, sensitive to McCarthy’s popularity among Massachusetts Catholics, hugged him close; Robert Kennedy even made the drunken demagogue godfather to his first child.) In 1950, when a Senate report declared McCarthy’s allegations a “fraud and a hoax,” Senate Republicans voted against it three times. In 1952, GOP presidential candidate Dwight Eisenhower campaigned with McCarthy in Wisconsin, even after McCarthy had attacked Ike’s old boss, General George Marshall.

The GOP initially coddled Trump too. In 2012, despite Trump’s barely veiled racism, Mitt Romney said that, “having his endorsement is a delight” and deployed him as a campaign surrogate. Last month, when Trump announced his presidential candidacy in a speech calling Mexican immigrants “rapists,” the Republican National Committee still welcomed him into the race. Trump, the RNC declared, was a “high-caliber candidate.”

It was only when McCarthy targeted the United States military that Republicans began taking him on. In late 1953, when McCarthy began investigating alleged communist influence in the Army, the Army counterattacked, accusing the Wisconsin Senator of using his influence to win special favors for a former aide now serving as a private. In March 1954, Vermont Republican Ralph Sanders proposed stripping McCarthy of his committee chairmanship. That June, Army lawyer Joseph Welch punctured McCarthy with the famous line, “Have you no sense of decency, sir, at long last? Have you left no sense of decency?” And in December, the Senate censured McCarthy, effectively ending his political career. Half the Republicans in the Senate voted yes.

Although it’s too early to declare Trump’s political career over, the last few days resemble McCarthy’s descent in 1953 and 1954. Even before last weekend, Republican elites increasingly viewed him as a political liability. Then, on Saturday, Trump ventured beyond his previous “soft” targets—immigrants, blacks, and President Obama—and claimed John McCain was not really a war hero. Trump’s GOP opponents, who until then had mostly tried to ignore him, pounced. Trump had “said some useful things,” declared Weekly Standard editor Bill Kristol on ABC. He had “brought some people into the Republican tent. [But] he jumped the shark yesterday.” Trump, Kristol predicted, would collapse in the polls because “GOP primary voters respect the military.” The implication is that neither those voters, nor Kristol himself, respect Mexican immigrants enough to have turned against Trump when he insulted them.

One key lesson from both Trump and McCarthy’s demagoguery is that it was not inevitable. Both men would have happily taken up some other cause had it offered them a path to fame and power. It was their own party, and political elites more generally, who bred the hostility and fear that they exploited. It’s fine that Republicans are today denouncing Trump for his comments about John McCain. But until more Republicans confront the demonization of Mexican immigrants into which Trump has tapped, until they summon their outrage on behalf of people who don’t look or vote like them, someone else in the Trump/McCarthy mold will come along sooner or later. It’s only a matter of time.