Pakistan's Imran Khan is fighting to hold on to power. Here's what happens next

Pakistan's Prime Minister Imran Khan speaks in Islamabad, Pakistan on June 4, 2021.

Islamabad, Pakistan (CNN)Pakistan is in political turmoil as the South Asian country awaits a key court ruling that will decide whether embattled Prime Minister Imran Khan's plan for an early election can go ahead.

Khan called the election in a dramatic attempt to cling to power after the deputy speaker of parliament blocked a no-confidence motion against him last Sunday that had appeared almost certain to succeed.
That move, and Khan's subsequent dissolution of parliament, enraged an opposition that for months have been demanding his removal over claims of poor governance and economic mismanagement.
    The opposition responded by accusing Khan of treason and asking the country's highest court to rule on whether the Prime Minister had breached the constitution. The court battle is the latest escalation in a crisis that has been smoldering for weeks, with Khan already having lost the backing of key political allies and the country's powerful military.
      Khan's main hope now appears to be that his enduring popular appeal with voters -- fueled by his stellar former cricket career, his unique brand of Islamic populism and his claims of foreign interference in Pakistan's affairs -- can keep him in the driving seat.
      But an unfavorable ruling by the Supreme Court -- which resumes its hearing on Tuesday -- would leave Khan's leadership hanging by a thread.

      Why is Khan in trouble?

        Pakistan, a nation of 220 million, is notoriously hard to govern. It has struggled with political instability since its formation in 1947 with multiple regime changes and military coups. No Prime Minister has ever completed a full five-year term.
        Khan's problems date back to 2018, when he rose to power in an election mired in accusations of vote-rigging and foul play.
        More recently, he has been dogged by claims of economic mismanagement. The cost of basic necessities such as food and fuel are skyrocketing, with inflation in the double digits, and the government's foreign exchange reserves are fast depleting.
        Some members of Khan's coalition government had deserted him over his perceived failure to work with them and he has alienated the military -- long a kingmaker in the country's politics -- that once supported him.
        On March 8, the opposition filed for a no-confidence vote to be held in parliament as they urged Khan to resign. The Prime Minister's subsequent actions have only fueled his critics, with opposition leader Shehbaz Sharif calling them "nothing short of high treason."

        Why has the military abandoned Khan?

        Pakistan's military, which has long influenced foreign policy, appears to have been angered by a series of diplomatic moves by Khan that have shifted the country away from the United States and closer to China and Russia.
        For much of his term, Khan has pushed anti-American rhetoric, blaming the US for the situation in Afghanistan. In a sign of how frayed relations have become, US President Joe Biden and Khan have not spoken since Biden took office last year.