ISLAMABAD -- Pakistan's former Prime Minister Imran Khan left a high court in Islamabad on Friday after being granted broad protection from arrest in multiple legal cases against him. The ruling struck a blow to the government in a stand-off that has sparked days of rioting by Khan's followers and raised the spectre of widespread unrest in the country.
After the court granted him bail, Khan spent hours more in the building, as he and his legal team were locked in apparent negotiations over his exit from the site.
As he headed to his home in the eastern city of Lahore, Khan put out a video statement from his vehicle saying the Islamabad police tried to keep him within the courthouse through different tactics, and authorities allowed him to travel only when he threatened to tell the public he was being held there against his will.
Security was extremely tight around the court ahead of Khan's departure as authorities expressed concerns for the former leader's safety. In the evening, shots were heard in the area of the courthouse. Police were investigating who opened fire, the interior minister said. Clashes between his supporters and police have periodically erupted outside the building.
The long list of around 100 court cases, on charges ranging from fomenting violence to corruption, still stands against Khan. But the week's turmoil illustrated the danger of moving against him. After he was abruptly arrested on Tuesday, widescale protests erupted, turning into clashes with police and mob attacks on government buildings and even military installations.
The court's ruling was a victory for Khan, and averted any new arrest for the time being. The Islamabad High Court gave him protection for two weeks on one graft charge and protection until Monday on a host of other charges in a measure called "anticipatory bail." The protections in each case can be extended, but it was not immediately clear if that meant a new court hearing on Monday.
The charismatic 70-year-old Khan, a former cricket star turned Islamist politician, has a broad base of support around Pakistan, presenting himself as an outsider victimized by the military and the political dynasties that have long run Pakistan. Opponents, meanwhile, call him a corrupt demagogue stirring his followers into violence. He was removed as prime minister in April last year in a vote of no-confidence by Parliament.
Interior Minister Rana Sanaullah Khan, who is not related to the former prime minister, told independent GEO television that the government will respect the court order. He said he could not say whether another attempt would be made to arrest Khan in the coming days but said all those involved in violence will "not be spared" prosecution.
When asked by reporters in the court building whether he could be arrested despite the rulings, Khan replied, "So who will control my people if I am arrested?" He said he had not been aware of the violence that followed his arrest until Thursday.
Friday's broad rulings were unusual, fueling government complaints that the judiciary was biased in favour of the former prime minister.
"This is judicial activism and politicizing of the judiciary," legal expert Arfan Qadir told The Associated Press, calling the rulings unprecedented. "Such decisions will continue to come until the supremacy of the Parliament is ensured."
The standoff threatens to open a deeper vein of turmoil in a country that has seen multiple military takeovers and bouts of violence. The unrest has echoed what followed the 2007 assassination of former Prime Minister Benazir Bhutto during an election rally. Her supporters at the time, outraged by her killing, rampaged for days across Pakistan.
It was not clear what prompted Tuesday's arrest of Khan, who had been free despite the multiple cases against him since he was ousted from office.
Whatever the reason, it was startlingly heavy-handed: Agents from the National Accountability Bureau burst into the Islamabad High Court where Khan was attending a session on other charges -- the same court where he appeared Friday -- and dragged him away, putting him into an armoured vehicle.
The response from his followers was swift. Protesters clashed with police, burned vehicles and looted shops in various parts of the country. Mobs attacked the headquarters of the military in Rawalpindi and ransacked and burned the residence of a top general in Lahore, Pakistan's second largest city, along with attacks on other military and government buildings.
The violence left at least 10 Khan supporters dead. Dozens of protesters and more than 200 police officers were injured. The government responded with a crackdown, arresting nearly 3,000 people. During Friday's court hearing, Khan supporters set fire to a police vehicle nearby when security forces wouldn't let them approach the building.
On Thursday, the Supreme Court ruled that Khan's arrest was unlawful and asked the Islamabad High Court to review its own previous decision allowing the arrest. In the meantime, Khan was released from custody and spent the night under security forces' protection in a government rest house.
Fazalur Rehman, the head of the ruling coalition parties, said its supporters would stage a sit-in Monday outside the Supreme Court. "The Supreme Court and Islamabad High Court have given protection to a corrupt person," he told a news conference.
Speaking earlier at a special Cabinet meeting Friday, Prime Minister Shahbaz Sharif said there was a "genuine corruption case" against Khan, "but the judiciary has become a stone wall protecting him."
The various cases against Khan include allegations that he incited violence and threatened police and government officials. A new terrorism charge was filed against him Thursday for allegedly inciting his followers to violence after his arrest.
He also faces at least three graft cases, including accusations from the National Accountability Bureau that he accepted millions of dollars worth of property in exchange for providing benefits to a real estate tycoon.