Pakistan's Supreme Court on Thursday ordered the release of former Prime Minister Imran Khan, whose arrest on corruption charges earlier this week sparked a wave of violence across the country by his supporters.

After the ruling, violence around the country appeared to ease, though clashes between celebrating supporters of Khan and police briefly broke out near the Supreme Court building. The government, however, denounced the ruling and said it was determined to find other legal avenues to arrest the former premier.

For a nation accustomed to military takeovers, political crises and violence, the turmoil of the past week has been unprecedented. Since Khan's dramatic arrest on Tuesday, protesters have been clashing with police in areas around the country, and mobs have attacked military and government sites, trying to storm the military's main headquarters and burning down the residence of a top general in Lahore. The government responded with a crackdown on Khan's supporters, arresting more than 2,000 so far.

FORMER PAKISTANI PRIME MINISTER IMRAN KHAN RALLIES THOUSANDS OF SUPPORTERS DESPITE ARREST WARRANTS

The Supreme Court ruled Khan’s arrest two days ago was illegal and, while it freed him from custody, it ordered him kept under protection of security forces in a safe location in the capital, Islamabad. The head of his legal team, Babar Awan, underlined that Khan is a "free citizen" and will be allowed to meet with lawyers and supporters. Chief Justice Umar Ata Bandial urged Khan to appeal to his supporters to remain peaceful.

Khan will appear Friday before the Islamabad High Court to reconsider its earlier ruling that the arrest was legal. Khan may also ask the court for protection from future arrest on the corruption charges.

Speaking on Pakistan's Dunya TV, Interior Minister Rana Sanaullah Khan vowed, "We will arrest him again," perhaps on charges that were announced a day earlier of inciting the wave of violence. The minister is not related to the former prime minister.

The ruling infuriated the government, with multiple officials accusing the chief justice of bias toward Khan. Chief Justice Bandial "now should hoist the flag of Imran Khan’s party on the Supreme Court, or he should declare that the court is a sub-office of Imran’s party," Azam Tarar, an adviser for Prime Minister Shahbaz Sharif, told reporters.

former Prime Minister Imran Khan's supporters

Supporters of Pakistan's former Prime Minister Imran Khan chant slogans outside the Supreme Court as they celebrate the court’s decision to release Khan in Islamabad, Pakistan, on May 11, 2023.  (AP Photo/Anjum Naveed)

Defense Minister Khawaja Mohammad Asif called it a "special reprieve" for the former prime minister, saying the court ignored his supporters’ attacks on military and government installations.

The violence has escalated a long burning confrontation between the former prime minister and Sharif's government. Khan was removed from office a year ago by a no-confidence vote in Parliament, but he still holds fervent support in many areas. He also faces at least 100 criminal charges against him filed by various government agencies, mostly on corruption. Khan has depicted his removal and the charges as part of a campaign against him by Sharif, the United States and the Pakistani military — a claim all three deny.

The spark was the former leader's dramatic arrest on Tuesday. Khan was in court for one set of charges, when anti-graft agents barged in, dragged him away and shoved him into an armored vehicle in connection to other charges.

FORMER PAKISTAN PRIME MINISTER IMRAN KHAN ARRESTED ON CORRUPTION CHARGES BY POLICE

In the violence that ensued, at least 10 of his supporters were killed and dozens of protesters and more than 200 policemen injured. Protesters torched trucks, cars and police vehicles in the streets and blocked highways. It has echoed unrest that 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.

Police filed new terrorism charges on Thursday against Khan and top leaders from his Pakistan Tehreek-e-Insaf party on charges of inciting mobs to violence.

In an address to the nation late Wednesday, Sharif said Khan was arrested because of his involvement in corruption, and that there was evidence backing up these charges.

He said the unrest had forced him to deploy the military in Islamabad, in Punjab – Pakistan’s most populous province — and in volatile regions of the northwest.

CLICK HERE TO GET THE FOX NEWS APP

Following the violence, the government shut down schools, colleges and universities in Punjab and northwestern Khyber Pakhtunkhwa provinces, where Khan has massive grassroots support and where most of the violence was reported. At least seven of the protester deaths so far have been reported in Khyber Pakhtunkhwa and two in Punjab’s capital Lahore, along with one in the southwestern city of Quetta. The government also suspended internet service in various parts of the country.

"We will arrest all those who disrupted law and order," said Mohson Naqvi, the chief minister in Punjab.

Protester attacks on the military have been startling. The military has directly ruled Pakistan for more than half of the 75 years since the country gained independence from British colonial rule and wields considerable power over civilian governments.

Khan supporters have attacked the military headquarters in Rawalpindi and security posts in the northwest. In Lahore on Tuesday night, demonstrators ransacked and burned down the residence of the regional commander, Lt. Gen. Salman Fayyaz Ghani.

The military vowed on Wednesday to respond to attacks by demonstrators with full force. It said the attacks on its installations were launched in an orchestrated manner, and the violence was a "black chapter" in the country’s history.