ISLAMABAD (BLOOMBERG) – Pakistan’s military-backed establishment faces a dilemma: The more they seek to boot Imran Khan out of politics, the greater the risk he becomes even more popular.

Since his ouster in a no-confidence vote in April, Mr Khan has sought to rally his supporters in the world’s fifth-most populous country to hit the streets and push for a fresh national vote. The campaign has been paying off lately, with his party winning key by-elections.

The former cricket star has also drawn tens of thousands of people to rallies in which he rails against Pakistan’s military, which has ruled the country for about half of its history and retains outsized influence over elected governments.

Over the weekend, Mr Khan gave a fiery speech in the capital Islamabad lashing out at senior police officials and a judge who were involved in the arrest of one of his aides.

He now faces possible arrest over a police complaint related to the speech filed under the country’s anti-terrorism law, while a court separately ordered Mr Khan to appear before it next week as it mulls possible contempt of court charges for comments deemed to threaten judicial officials.

The government is also looking at ways it can ban his party, Pakistan Tehreek-e-Insaf, from national elections that must be held by late next year.

But a strategy of trying to silence Mr Khan, 69, could easily backfire. On the streets, he has tapped into deep public resentment over a broken economy and a political system beholden to dynasties and unelected power brokers.

Mr Khan’s party also recently notched victories in local elections in the financial capital Karachi and the most-populous province of Punjab, which is often seen as a litmus test for the national mood.

There are also signs that he still retains plenty of silent allies in the military even if he’s fallen out of favour with the army chief, Qamar Javed Bajwa. Retired army officials have attended pro-Khan rallies in recent months.

“Imran’s fight seems to be with General Bajwa and not with the military as a whole,” said Mr Akhil Bery, director of South Asia Initiatives at the Asia Society Policy Institute in Washington. “Of course, the rank and file will continue to support the chief, but that doesn’t mean that they can’t be supportive of Khan as well.”

When Mr Khan first rose to power in 2018, he was criticised for being too close to the military even as he promised to oversee a “New Pakistan” rid of corruption and nepotism. He then lost establishment support when he publicly clashed with Bajwa over who should lead the Inter-Services Intelligence, or ISI, which oversees Pakistan’s internal security.

His decline came just as Pakistan’s finances were deteriorating, forcing new Prime Minister Shehbaz Sharif to make painful choices in a bid to shore up foreign exchange reserves while grappling with record-high inflation.

Further unrest may impact Pakistan’s bid to access US$1.2 billion (S$1.67 billion) from the International Monetary Fund, which conversely may drive more voters towards Mr Khan.

His fate could reverberate far beyond Pakistan. After losing power, he accused the US of conspiring with Sharif as prime minister, who’s perceived as more friendly with leaders in Europe and America. During his tenure Mr Khan shifted Pakistan closer to China and Russia, upsetting some in the establishment who sought a more balanced relationship with major powers.