Former Prime Minister Imran Khan of Pakistan appeared at court on corruption charges on Saturday in Islamabad, the capital, in the latest turn of a standoff between his supporters and the authorities that had led to chaotic scenes of tear gas and clashing security lines outside his home earlier in the week.
That showdown continued on Saturday morning, as Mr. Khan arrived at the court surrounded by throngs of his supporters, who clashed with the police outside the judicial complex. The court allowed Mr. Khan, who claimed he could not enter the judicial building because of the chaos outside, to register his appearance from inside his vehicle.
Mr. Khan, who was removed from office in a parliamentary no-confidence vote in April, is facing dozens of court cases on charges that include terrorism and corruption. Several arrest warrants have been issued against him after he repeatedly refused to appear in court in Islamabad. The court hearing he attempted to join on Saturday involved accusations of illegally profiting from accepting state gifts, and of concealing his assets.
The clashes this week, as the police tried to arrest Mr. Khan at his Lahore residence, were the latest show of political brinkmanship to play out on the streets in Pakistan, as clouds of tear gas mixed with angry crowds of Mr. Khan’s supporters that have camped out outside his home and effectively taken on the role of his personal body guards.
The violent scenes offered a grim reminder of the state of politics in Pakistan, which has struggled with instability and military coups since its founding 75 years ago. The political scene has become a game of clashing dynasties that take turns falling in and out of favor with the country’s powerful military establishment, with the victors wielding the country’s justice system against their rivals.
Since being ousted from power last year, Mr. Khan has led a powerful political campaign drawing tens of thousands to rallies across the country, demanding fresh elections.
At the same time, the state has brought dozens of court cases against Mr. Khan. He and his supporters have characterized the accusations as a misuse of the justice system by the government of Prime Minister Shahbaz Sharif and by the military in order to sideline Mr. Khan from politics. Pakistani political and military leaders have repeatedly denied those claims.
The political tensions surrounding Mr. Khan came to a head in November, when the former prime minister was wounded during a political rally after an unidentified man opened fire on his convoy, in what aides have called an assassination attempt. Since then, Mr. Khan has been mostly ensconced at his residence in Lahore, Pakistan’s second-largest city, and has refused to appear in court in Islamabad.
Fawad Chaudhry, a senior leader of Mr. Khan’s political party, Pakistan Tehreek-e-Insaf or P.T.I., said that the threat to Mr. Khan’s life makes court appearances much riskier, adding: “It is not humanly possible to make court appearances in such a vast number of cases.”
Mr. Khan claims that the state has brought more than 86 court cases against him. Government officials say he is facing around 30 cases.
The drama surrounding Mr. Khan seems to only have buoyed his popularity, analysts say, underscoring his unique ability to outmaneuver Pakistan’s typical playbook for sidelining political leaders who have fallen out of favor with the country’s powerful military.
On Tuesday, police officers, wearing white helmets and holding shields, lined up outside Mr. Khan’s residence in Lahore to execute an arrest warrant for the former prime minister for failing to appear in court. The police used baton charges and tear gas canisters to scatter the members and supporters of Khan’s political party during the lengthy fight, which lasted for hours and into the evening.
Leaders of Mr. Khan’s political party took to social media to share footage of tear gas canisters landing on the lawn outside his drawing room. The video clips showed party workers throwing a canister back at police from across a nearby wall. In another video, party workers, holding sticks, were seen running for cover as tear gas clouds engulfed the driveway of Mr. Khan’s residence.
As battles consumed the outskirts of his home, Mr. Khan made an impassioned plea to his supporters through a recorded video message, urging them to fight for their freedom and rights in the face of impending arrest by the police. Mr. Khan vowed to continue fighting as he exhorted his followers to show that they could stand up for their rights even in his absence.
“If they send me to jail, or if I am killed, you have to show you can fight without me as well,” Mr. Khan said in the video.
Mr. Khan has been criticized by his opponents for attempting to avoid arrest and refusing to appear in court. But the violent showdown outside his home drew widespread criticism.
“I am deeply saddened by today’s events. Unhealthy revenge politics,” Arif Alvi, Pakistan’s president and a member of Mr. Khan’s political party, tweeted on Tuesday, adding that it showed “poor priorities” of a government “that should focus on economic misery of the people.”
After those clashes, Mr. Khan agreed to appear in court on Saturday, traveling early that morning from his home in Lahore to Islamabad in a convoy flanked by large crowds.
As he made the hourslong trip, the police returned to his Lahore residence and dismantled the barriers and sandbag bunkers erected outside his home. Then another clash broke out: The police say that they were shot at and that petrol bombs were thrown at them. Sixty-one people were arrested, said Amir Mir, the interim information minister of Punjab Province.
Some had hoped that Mr. Khan’s appearance in court on Saturday would defuse the tension that had built up over the past week. But the clashes in Lahore and outside the courtroom in Islamabad only added to the sense of chaos that has seized Pakistan in recent months.
As the standoff drags on, Mr. Khan’s ability to parlay attempts to sideline him into political popularity has upended the Pakistani political sphere, analysts say, and shaken the wide-held belief that the military establishment — long seen as the invisible hand guiding politics — has a firm grasp on the wheel.
“If Pakistan still had a functional establishment like what we have always imagined, Imran Khan would either already be prime minister or firmly in jail and sidelined from politics,” said Adil Najam, a professor at Boston University’s Frederick S. Pardee School of Global Studies and an expert on Pakistani politics, referring to the military as the establishment, as it is popularly known in Pakistan. “The establishment has imploded — its assumed authority has gone away.”