As his campaign gets underway in earnest, it is increasingly clear that President Trump is modeling himself on two effective but discredited American politicians: Richard Nixon and Joseph McCarthy.

In recent weeks, these two repudiated historical figures have lurked in the background of every speech and tweet. They’re there when Trump talks about a “tremendous ... struggle for the future” against an emboldened “left-wing mob” that “hates our country,” and when he warns of “rioters, arsonists and left-wing extremists ... explicitly identified with ideologies such as Marxism that call for the destruction of the United States system of government.” They’re there when Trump describes a hapless, enfeebled Joe Biden taking orders from his “radical left bosses” who hate “everything we prize as Americans.”

Let’s start with McCarthy. First elected to the U.S. Senate from Wisconsin in 1947, McCarthy wasn’t the only politician of his day who railed about a homegrown communist conspiracy of fanatical leftists threatening the nation’s national security and way of life. But his particular brand of reckless demagoguery — withering ad hominem attacks and flagrant disregard for the truth — made his name synonymous with his shameful era, and are being echoed now in Trump’s rhetoric.

McCarthy manipulated public fear opportunistically, stoking dread of a “Red Menace” to transform himself from an obscure Midwestern Republican politician into a figure of national prominence. A heavy drinker with thinning, slicked-back hair, he rose to instant fame with a speech in Wheeling, W.Va., in 1950, in which he claimed to hold in his hand a list of 205 communists working in the State Department. Like Trump saying without evidence that Joe Biden has dementia or that Barack Obama is guilty of treason, McCarthy offered little proof to back his hyped and embellished accusations of disloyalty.

McCarthy also insisted that the Democrats were protecting and enabling these dangerous subversives. Sound familiar? He trafficked in conspiracy theories, just as Trump does when he says that left-wing mobs are preparing to tear down statues of Jesus or that there is a “deep state” of career government officials conspiring to undermine his administration.

The descriptions below sound eerily Trumpian:

McCarthy “was not ... a true believer,” wrote historian Arthur Schlesinger. “He was not a man of principle. He had no great program to offer; indeed he was conspicuously uninterested in the social and economic problems of his time. His ambition ... was to be in the headlines. He was an alley fighter who relished confusion and trouble and tumult.”

“He couldn’t resist falsification,” said New Yorker writer Dwight Macdonald.

“He knew a good deal about people’s fears and anxieties, and he was a superb juggler of them,” wrote Richard Rovere, one of McCarthy’s biographers. “But he was himself numb to the sensation he produced in others. He could not comprehend true outrage, true indignation, true anything.”

The similarities between Trump and Richard Nixon are equally clear and even more explicit. In 1968, the year Nixon won his first term, the country was shaken by the assassinations of Martin Luther King Jr. and Robert F. Kennedy, by unrest in the “inner cities” and by increasingly radical antiwar and civil rights protests. While some of the Democratic candidates urged an end to the Vietnam War and an expansion of civil rights, Nixon campaigned to what he called the “silent majority” of voters with warnings about a looming “showdown with anarchy” in the U.S. He made it clear that while Democrats could be counted on to coddle the anarchists, he was the candidate of “law and order.”

Trump’s adoption of Nixon’s language seems neither accidental nor unconscious. Since the Black Lives Matter protests began, Trump has tweeted 16 times about “law & order” — a phrase more closely associated with Nixon than anyone else. Trump also has tweeted about the “silent majority” — Nixon’s term — 11 times. Trump has tweeted about what he called the Democrats’ “mob rule strategy,” echoing Nixon’s warnings about the dangers to democracy “if mob rule takes hold in the U.S.” He has lifted the Nixon playbook in its entirety.

Nixon’s strategy had a not-so-subtle racial component. He sought the support of white suburban voters, many of them blue-collar, fueling their fear of Black militancy and lawlessness through code phrases about the ills of America’s urban areas. When Nixon ran for reelection in 1972, Charles Colson, a top aide, counseled him to go farther and paint the Democrats as “the party in favor of sacrificing the majority of Americans ... to appease a racial minority.”

Trump too is a practiced manipulator of the politics of racial grievance and resentment. Since the death of George Floyd, he has retweeted racists and sent out coded signals about urban “looters,” “thugs” and “hoodlums” to his overwhelmingly white base.

Trump, at the end of the day, is more irresponsible and dishonest than either Nixon or McCarthy. But he learned from their examples. He knows they reaped rewards for warning of anarchy, mob rule, disloyalty and subversion. He understands that fear is an effective tool for winning votes.

But he should remember this too: Neither McCarthy nor Nixon ended their careers well. McCarthy took his ugly tactics too far and his power waned after the Army-McCarthy hearings in 1954, when Army counsel Joseph Welch chastised the senator for his cruelty and recklessness, and asked him on national television: “Have you no sense of decency, sir?”

Nixon, for his part, was drummed out of office in disgrace in 1974, in the middle of his second term, during the explosive investigation into the Watergate scandal and the subsequent cover-up.

These are Trump’s role models, though there are few politicians in American history less deserving of emulation. They’re bad company.

@Nick_Goldberg