Pakistani Prime Minister Shahbaz Sharif on Saturday ordered authorities to identify and arrest all those involved in the violence, after the arrest of former Prime Minister Imran Khan last week sparked unrest in the country that caused deaths.

Facebook, YouTube and Twitter were inaccessible in Pakistan on Saturday after they were made available late on Friday, according to Reuters.

Khan left the courthouse yesterday evening for his hometown of Lahore, under heavy security after the court released him on bail.

Khan's arrest on Tuesday in connection with a land fraud case, which the Supreme Court has ruled "null and void", sparked violent protests from his supporters.

His supporters overran military institutions, set fire to a building belonging to an official broadcasting station, smashed buses, and also attacked the home of a senior army official and other property, leading to the arrest of about two thousand people and the deployment of the army in several cities.

At least eight people were killed in the incidents, a bout of unrest in a country facing an economic crisis, with record-high inflation, weak growth and disruption of IMF funding.

Khan, who is expected to address supporters online later on Saturday, welcomed the court's bail order and said the judiciary was Pakistan's only protection from the "jungle law".

He also told reporters inside the court: "I have to say that I expected this from the judiciary because it is the only hope left now."

Khan, 70, a cricketer-turned-politician, was ousted as prime minister in April 2022 in a parliamentary vote of no confidence.

Khan is Pakistan's most popular political leader according to opinion polls and the only prime minister in the country's history to have been ousted by a vote of no confidence.