This weekend, the US government shutdown – the longest in history – will enter its fifth week. As public outrage grows, many elected Republicans are becoming markedly distressed that their party, and especially US president Donald Trump, are being blamed.

Mr Trump originally claimed that he would be "proud" to force the shutdown if Congress refused him $5 billion for his border wall and pledged not to blame the Democrats. Yet as soon as the shutdown began, he was quick to accuse them of being responsible –but Americans aren't buying it. A Reuters poll earlier this month found more than half blamed him for the shutdown while only one in four backed his stance.

Both the wall and the shutdown are generally unpopular. So why is Mr Trump insisting on this dangerous and apparently self-destructive showdown?

Most explanations focus on his personality. He is stubborn and does not want to accept defeat. He is also politically naive and got into this stand-off without a viable strategy for winning or ending it.

But in fact, this political highwire act reflects Mr Trump at his most canny and calculating.

Senate Republicans are furious because they voted for a politically hazardous budget compromise with Democrats after Vice President Mike Pence assured both sides the president would support it.

But when far-right commentators excoriated Mr Trump for backing down on wall funding, he refused to sign the interim spending bill and initiated the shutdown.

Mr Trump is convinced that his anti-immigrant stance, through which he poses as the champion of white American tribalist interests, was key to his 2016 victory and will be critical to his re-election in 2020. But he needs his political base to stand firmly behind him, not just in two years but in the coming weeks.

The president is looking increasingly exposed, legally and politically. Questions about his relationship with Russia are intensifying. This weekend, the plot thickened when the news site Buzzfeed reported that the president allegedly ordered his former lawyer Michael Cohen, currently serving three years in prison, to lie to Congress by denying that work on a skyscraper project in Russia continued well into the 2016 campaign. Special counsel Robert Mueller, who is investigating Russian interference in the election, took the rare step of issuing a statement to dispute the story’s accuracy.

Suspicions are growing about the nature of the relationship between the president and Moscow. Mr Trump seriously discussed withdrawing the US from Nato last year, Russia's ultimate strategic goal. Meanwhile his former campaign chairman, Paul Manafort, who was convicted of financial crimes last year, is now accused of passing campaign data to Russia. Mr Trump’s lawyer Rudy Giuliani denied Mr Trump colluded with Russia but suggested others in the campaign might have done so. Most perturbingly, the FBI initiated an unprecedented counter-intelligence investigation into whether the sitting president was a national security threat acting on behalf of Moscow.

The investigation began after Mr Trump fired then FBI director James Comey in May 2017, saying he was fed up because "this Russia thing” was a “made-up story” and reportedly telling senior Russian officials, according to the New York Times, that he had been under "great pressure" but now "that's taken off”.

Mr Mueller’s statement in response to the Buzzfeed story was exceptionally vague and could mean that the story is false – or that his office wants to distance itself from the leak, thought to come from two anonymous law enforcement sources. Buzzfeed has not identified its sources but they could be New York prosecutors rather than part of the Mueller team.

_______________

Read more from Hussein Ibish:

There is a disconnect between what Trump says and what foreign policy hawks think

Republicans face tough choices in a turbulent year

The last of the grown-ups has left the Trump administration

_______________

If Mr Trump suborned perjury before Congress, his presidency would be effectively over. More than just a serious crime, obstruction of justice was central to the articles of impeachment tabled against both Republican Richard Nixon and Democrat Bill Clinton.

While Mr Mueller’s statement casts significant doubt on the specific claim, many legal and political walls still seem to be closing in on Mr Trump.

Impeachment is no longer a far-fetched scenario. Indeed, Mr Trump could find himself in the dock in 2021 rather than back in the Oval Office.

Even if he never faces such extreme legal jeopardy, his political vulnerability is only going to intensify as Democrats in the House of Representatives begin investigating his activities with the vast congressional oversight powers that Republicans have so far failed to deploy.

So Mr Trump needs his base to stick with him. He must ensure that they and extreme right-wing pundits continue to regard him as an indispensable leader and hold Senate Republicans in line.

The issue that cements Mr Trump to his nativist base is opposition to immigration, as symbolised by the wall.

Mr Trump appears to be preparing to propose a compromise to the Democrats. But he has also threatened to declare a national emergency as an autocratic way to bypass the political process and fund the wall, despite Congress's otherwise absolute power of the purse.

Even if he ultimately fails to secure funding for the wall, as seems likely, as long as his base believes he is doing everything possible to fight tooth and nail for it, he can probably retain their devotion.

For Mr Trump, that’s not just a re-election strategy. It is a survival strategy for the here-and-now.

Hussein Ibish is a senior resident scholar at the Arab Gulf States ­Institute in Washington