WASHINGTON — President Trump has proved himself adroit at creating villains to serve as his political foils. In his State of the Union address on Tuesday, he introduced a new one: socialists.

Right after his calls to support the overthrow of Venezuela’s president, Nicolás Maduro, and condemning the “socialist policies” that have reduced the country “into a state of abject poverty and despair,” he made a quick segue to the home front.

“Here in the United States, we are alarmed by new calls to adopt socialism in our country,” the president said, adding, “Tonight, we resolve that America will never be a socialist country.”

Tuesday night’s speech contained more than a few suggestions of what Mr. Trump’s 2020 campaign could look like. The president dwelled on the economy, pointing to the low unemployment rate, continuing growth and the tax cut passed by the last Republican Congress. He spoke of trying to reduce prescription drug costs and battling H.I.V., perhaps with an eye to the kinds of suburban female voters who deserted Republicans in the midterm elections. And for his hard-core followers, he argued for the border wall.

The threat of socialism was something new. But it could become the kind of rhetorical touchstone of his re-election campaign that sounding the alarm about “criminal illegal aliens” was in 2016.

If it does, it could provide Mr. Trump with a potentially effective weapon in confronting an increasingly aggressive and more liberal Democratic Party, defining it through attacks on Senator Bernie Sanders of Vermont and Representative Alexandria Ocasio-Cortez of New York, who describe themselves as democratic socialists, and other members of the party pushing progressive policies like a 70 percent tax rate and “Medicare for all.”

The president’s economic advisers began sounding the socialist alarm in the fall in a 72-page report criticizing what it described as the socialist ideas of leading Democrats, linking them with the failed economic policies of communist governments in China, the former Soviet Union and other countries. The word “socialism” appeared 144 times — on average, twice a page.

The report by the White House Council of Economic Advisers, “The Opportunity Costs of Socialism,” did not prescribe any action but was meant to serve as a warning about the destructive economic policies that Mr. Trump believes Democrats would inflict on the United States.

Policies like tuition-free college were mentioned in the same ominous tone as the atrocities committed by Vladimir Lenin and Mao Zedong. The report suggested that Democratic policies emulating Venezuela would cause the American economy to shrink by 40 percent, just as Mr. Trump did on Tuesday night.

Yet there is no evidence of any growing public angst about socialism sweeping the United States. As a political philosophy and organizing tool, it took modest root in the country in the late 19th and early 20th centuries, but never gained widespread appeal. Eugene V. Debs, a labor leader from Terre Haute, Ind., was a five-time candidate for president, never to great effect, peaking at 6 percent of the vote in 1912.

“You really have not had a self-consciously socialist movement of any size and influence since the 1930s,” said Michael Kazin, a professor of history at Georgetown University and the author of a history of the American left. “Clearly this is an attempt to portray Democrats as too radical for Americans and to connect them to Venezuela, which is of course a clever thing do since Venezuela is falling apart under an ostensibly socialist government.”

But the supposed threat of creeping socialism — and the dangers posed by someone like Ms. Ocasio-Cortez — have become favorite talking points for conservatives like the TV personality Sean Hannity of Fox News, who tells his viewers that far-left socialism had taken over the Democratic Party. Mr. Trump is now firmly aligned with that view.

“Most Americans are obviously not up on the distinctions between democratic socialists and communists,” Mr. Kazin said. “He, like other conservatives who had talked about the so-called Red Menace over the years, is trying to confuse the two things in people’s minds.”

But that is not how conservatives look at the way Mr. Trump seems ready to portray Democrats.

“From a political standpoint, he is defending free enterprise, free markets and freedom,” said Greg Mueller, a conservative strategist. “They want to take the country toward socialism and their party is divided on that and there is a major fight in their party over whether to be a socialist party.

“This is a great debate for Trump to define in 2019 and the 2020 campaign,” he added.

Republicans, with limited success, tried at times to label President Barack Obama a socialist, particularly for his call for higher taxes on the wealthy, Mr. Kazin said, noting that this effort coincided with a shift in public opinion where Americans viewed socialism more favorably.

But a Gallup poll in August showed that Democrats had a more positive view of socialism than they do of capitalism, 57 percent to 47 percent. Their view has been relatively stable since 2010, but attitudes toward capitalism have become more negative, coinciding with the financial crisis that fueled animus toward the large banks and investment firms blamed for the economic devastation.

Among Americans ages 18 to 29, the Gallup poll found, 51 percent were positive about socialism while 45 percent viewed capitalism favorably. Gallup noted there was a marked, 12-point decline in younger adults views on capitalism is just two years.

“Every single policy proposal that we have adopted and presented to the American people has been overwhelmingly popular,” Ms. Ocasio-Cortez told MSNBC late Tuesday. And she dismissed Mr. Trump’s criticism. “He feels himself losing on the issues,” she said, and now must engage in ad hominem attacks.

But it was no accident that Mr. Trump chose to introduce the socialist menace in perhaps the highest-profile setting available to a president as the first step in trying to paint Democrats as too far left, just as they start to engage in a presidential nominating process that will shape the party’s image.

And even some of the president’s harshest critics say he may be on to something.

“The idea of throwing the socialist thing out there politically is pretty crafty because, truly, there is just enough truth in there to make it sticky and interesting,” said Mike Murphy, a Republican strategist and longtime Trump critic. “They are lurching left. For once, somehow, a little honesty crept into one of Trump’s proclamations. It’s code for the loony left.”

Correction:Feb. 7, 2019

An earlier version of this article misstated the year in which Eugene V. Debs won 6 percent of the vote for president. It was 1912, not 1916.

A version of this article appears in print on , on Page A1 of the New York edition with the headline: Framing Socialists as Villains, Trump Refreshes His Blueprint. Order Reprints | Today’s Paper | Subscribe