Pakistan's Supreme Court on Thursday declared former Prime Minister Imran Khan's arrest in a corruption case illegal, ordering his immediate release.
A three-judge bench led by Chief Justice Umar Ata Bandial, hearing a petition seeking the ex-premier's release, asked Khan to approach the Islamabad High Court (IHC) on Friday, which had declared the arrest lawful.
The CJP said the ex-premier will have to comply with the high court's ruling, and will stay at a police guest house Thursday night.
Khan, 70, was detained by the country's anti-corruption agency in a corruption case from the IHC on Tuesday, sparking countrywide protests.
He was produced before the judges amid tight security as hundreds of policemen and paramilitary troops were deployed across the top court building.
As violent demonstrations against Khan's arrest continued, the Pakistan Tehreek-e-Insaf (PTI) chairman called upon his workers to "stay peaceful."
"My message to the all is: desist from arson and violence. Don't attack public or private properties," he said in response to a remark by the chief justice asking him to denounce the violence that gripped the nation over the past three days after his arrest, according to local media.
Earlier, the chief justice had asked authorities to produce Khan before the court within an hour, questioning the manner in which he was arrested.
More arrests were made on Thursday amid the demonstrations. The PTI's top leadership including the country's former Foreign Minister Shah Mehmood Qureshi, former Finance Minister Asad Umar, and former Information Minister Fawad Chaudhry, remain under custody.
Khalid Khurshid, chief minister of the Gilgit Baltistan region, ruled by PTI, was also put under house arrest in the capital Islamabad.
The PTI had urged its workers to come out in droves to protest on the streets against what it termed "tyranny."
The party claimed that 47 workers were killed in protests across the country on Wednesday and 2,000 others were arrested, but Anadolu could not independently verify the figures.
Hospital sources confirmed seven people were killed and over 100 wounded, while over 1,200 were arrested across the country.
Army, police and paramilitary troops were also deployed in the cities of Peshawar, Lahore, Faisalabad, Multan, and Mardan, with the government imposing colonial-era restrictions on the gathering of more than five people.
Interior Minister Rana Sanaullah warned of a "zero tolerance" approach for those who take the law into their hands.
"There will be zero tolerance for those who take the law in their hands, we will not tolerate. We have directed the security forces to deal with the miscreants with an iron fist," Sanaullah tweeted.
The government has also suspended mobile internet and blocked social media platforms across the country, with schools remaining shut in many parts of the country.
Khan's PTI strongly reacted to a military statement, saying it is "contradicting the facts."
"ISPR's (military media wing) statement is contradicting the facts and is based on hatred and revenge against the most reliable, popular and largest party of Pakistan," the PTI said in a statement late Wednesday night.
The Pakistani army had said it had shown "maturity" and "restraint" in response to attacks on military installations, following the ex-premier's arrest.
"We are fully aware that a few miscreant party (Khan's Pakistan Tehreek-e-Insaf-PTI) leaders were behind this conspiracy, which aimed to compel the army to react," the military said in a rare statement on Wednesday.
It warned that any further attack on the state installations will no longer be tolerated.
Khan was arrested on Tuesday and taken into custody by the country's paramilitary troops, Rangers, from the Islamabad High Court where he was attending the hearing of his bail application as, according to Khan, the government has filed over 120 cases against him during the last one year.
He was arrested by the country's anti-corruption agency, the National Accountability Bureau, in connection with alleged corruption involving the Al Qadir University Trust.
It is alleged that the cricketer-turned-politician and his wife Bushra Bibi received billions of rupees and a large piece of costly land to build the educational institution in return for releasing an amount of £190 million ($239 million) to a property tycoon in 2020.
The amount was identified and returned to the country by the UK's National Crime Agency, following a settlement with real estate tycoon Malik Riaz in 2019.
The National Accountability Bureau, Pakistan's anti-corruption body, alleges that Khan's PTI government struck a deal with Riaz that caused a loss of more than $239 million to the national exchequer, in a quid pro quo arrangement with the businessman.
Khan and his party leaders, however, deny the allegations.
Khan, who served as prime minister of Pakistan from 2018-2022, lost a vote of confidence in parliament last April, one year short of completing his term.
In November, he survived an assassination attempt during a rally.
Since then, Khan has fallen out with the country's powerful army, and is facing a plethora of cases, which his supporters say are politically motivated.