Donald Trump had been intending to run a re-election campaign based on a strong economy and a socialist opponent. Both have vanished in the past month. But the US president still has his ultimate weapon: xenophobia.

Trump this week announced in a late-night tweet that he would “temporarily suspend immigration” into America. Two days later, when he signed an executive order, it only applied to people seeking green cards to move to the country permanently, not to temporary workers, and there were plenty of loopholes.

But by then the headlines had been written, the outrage expressed and the objective achieved: Trump was cracking down on immigration again because, he claimed, he was putting America and its workers first. The exercise was arguably less about policy than politics.

A nativist, populist message helped him win the presidency in 2016. He tried it again in the 2018 midterm elections for Congress with mixed results. Now, with his handling of a deadly pandemic under scrutiny and the economy in freefall, critics say he is ready to bet the White House on his ability to stir nationalist and racist sentiment with little subtlety.

“This is a president who doesn’t use the dog whistle of Republicans in the past, and even Democrats in the past who used dog whistle politics to talk about race in code,” said Juan Cartagena, president and general counsel of Latino Justice, a civil rights organisation. “This guy talks about it openly. Under normal circumstances he would have been a one-term president, but his base is pretty loyal and we’re still talking about a country that barely comes out in large turnout numbers.”

Apart from antipathy to globalised trade, Trump is said to be a man of few core political beliefs and little ideology

Apart from antipathy towards globalised trade, Trump is said to be a man of few core political beliefs and little ideology. But when he descended an escalator at Trump Tower in New York in June 2015 to declare his long-shot candidacy for president, he started as he meant to go on. Mexico, he complained, was not sending its best people across the border. “They’re bringing drugs. They’re bringing crime. They’re rapists.”

Trump also announced his signature issue: “I would build a great wall, and nobody builds walls better than me, believe me, and I’ll build them very inexpensively, I will build a great, great wall on our southern border. And I will have Mexico pay for that wall.”

Donald Trump speaks during a campaign rally in Charlotte, North Carolina, in October 2016. A nativist, populist message helped him win the presidency that year. Photograph: Erik S. Lesser/EPA

There followed an incendiary, taboo-busting election campaign in which “Build that wall!” became a familiar chant at Trump rallies, where he railed against the presidency of Barack Obama and threw red meat to his base. He lashed out at a judge of Mexican ancestry and a Muslim whose son died fighting for the US in Iraq. He threatened to ban Muslims from the country. He promised “America first”. And he won.

Two years later, campaigning on behalf of senators and representatives, Trump used rallies to stoke fears that “caravans” of undocumented immigrants from Guatemala, Honduras and El Salvador were set to pour into the US from Mexico. To the frustration of Republicans who wanted him to focus on economic achievements, he used vivid language to demonise criminal gangs and human traffickers and put victims’ families on public display.

What you will absolutely see this fall is that Donald Trump will come out and he will make up a story Rick Wilson

This time, the strategy was only partially successful: Republicans expanded their majority in the Senate but lost 40 seats in the House of Representatives, where the new Democratic majority went on to impeach Trump.

Early in 2020, the Trump re-election campaign appeared to be built on firm foundations. There were economic talking points – unemployment at its lowest for half a century, the stock market at record highs – even if it did not always feel that way on the ground. Meanwhile, Senator Bernie Sanders, a democratic socialist, was leading the Democratic presidential primary race, prompting Trump and allies to warn darkly of the radical left.

These scripts have been torn up. The coronavirus pandemic has killed about 50,000 Americans and is likely to surpass US losses in the entire Vietnam war. Since the outbreak also put the economy into a coma: at least 26 million people have requested unemployment benefits, wiping out all the job gains since the great recession of 2008.

People wait in line for help with unemployment benefits at the One-Stop Career Center in Las Vegas on 17 March. More than 26 million Americans have lost their jobs during the coronavirus crisis. Photograph: John Locher/AP

Rick Wilson, a political strategist and author of Running Against the Devil, an analysis of how the 2020 election could play out, said: “The predicates of Donald Trump’s campaign were fundamentally: ‘The economy is great and I made the economy great and also, by the way, this is my great economy. Have you noticed my great economy?’ That’s gone. If you claim you have sole control and credit for something, then when it goes wrong, the shoe gets placed on the other foot rather quickly, and it has.”

In the Democratic primary, meanwhile, Sanders quickly fell away against former vice-president Joe Biden, a moderate who served under Obama and will be much harder to caricature as a socialist menace.

Short of ammunition, his record in tatters, Trump can still fall back on the politics of division and made-for-TV partisan outrage. His daily White House coronavirus taskforce briefings have become a substitute for campaign rallies and regularly include progress reports on the border wall. The executive order on immigration, probably bearing the fingerprints of senior adviser Stephen Miller, was billed as a way to ensure that American workers take priority over foreigners in any economic recovery.

It has struck a chord with some of Trump’s supporters. Douglas Collins, 86, a neurologist from Pensacola, Florida, said: “We’ve got to get the economy up and running, and people who live pay cheque to pay cheque and are American have to be the first consideration. Is prejudice a major factor? I don’t think so.”

Doug Peltier, 69, from Forest Lake, Minnesota, said: “It’s a valid position to be concerned about the economy and immigrants coming and taking jobs from Americans. I’m not a bigot, I’m not against immigrants, I have a great deal of respect for Mexicans and blacks. I do believe Americans should come first. I guess you could call me a nationalist.”

Donald Trump takes a question during a news conference in the Rose Garden of the White House on 13 March. His freewheeling coronavirus briefings have taken the place of campaign rallies. Photograph: Andrew Harrer/Bloomberg via Getty Images

Peltier, a retired school administrator who attended a Trump rally in Minneapolis last year, added: “I think Trump has more support than a lot of people believe. We don’t boast; we tend to be more silent. I would never put a Donald Trump sticker on my car because I know it would get keyed.”

But opponents see something else: a president whose world collapsed around him, suddenly flailing in strange surroundings and grabbing on to a familiar lifeline. Wilson, the political strategist, argues that bigotry, hatred and prejudice “aren’t a bug of the Trump program – those are a feature.

“He will pursue what he looks at as something that was highly effective for him in the last campaign and that is a racially and ethnically inflected campaign that tries to tell Republican voters in particular that all of their problems and concerns and issues come from the brown people.”

Already Trump and Republican allies have hardened their line on China, fuelling a theory that the coronavirus might have accidentally escaped a laboratory in Wuhan and condemning the country for not raising the alarm earlier. They hope to couple this with an attack on Biden, dubbing him “Beijing Biden” and claiming he had a cosy relationship with China in the past.

Joe Biden thanks frontline workers from his home in Wilmington, Delaware, on 19 April. The former vice-president is hard for Trump to paint as a socialist. Photograph: Brian Cahn/Zuma Wire/Rex/Shutterstock

Wilson, who is co-founder of the Lincoln Project, a political action committee aiming to prevent Trump’s re-election, added: “What you will absolutely see this fall is that Donald Trump will come out and he will make up a story and it will be something like, ‘There’s boats full of diseased Chinamen coming our way, bar the door’.”

Democrats are braced for another bitter fight with a president who looks certain to lose the popular vote again but hopes to squeeze by in a few battleground states that decide the electoral college.

Neil Sroka, communications director for the progressive group Democracy for America, added: “What we should expect in 2020 is, because of the economic implosion, because of his massive mishandling of this crisis, he will pursue a xenophobic campaign that makes the 2016 effort look like patty cake.”