Pakistan's top court on Thursday said the anti-graft agency's arrest of former Prime Minister Imran Khan was illegal, broadcaster Geo TV reported.
Khan's arrest on Tuesday was the culmination of months of political crisis that saw the ousted leader wage a campaign of defiance against the powerful military.
The arrest has enraged supporters of his Pakistan Tehreek-e-Insaf (PTI) party. For two days, thousands of people have taken to the streets in protest around Pakistan, and violent clashes with security forces have erupted.
At least nine people have died in protest-related incidents, police and hospitals said.
Hundreds of police officers have been injured and more than 2,000 people arrested across the country, mostly in Punjab and Khyber Pakhtunkhwa provinces, police added.
At least seven officials from PTI's central leadership accused of orchestrating the protests were also detained.
On Thursday, police with batons and riot shields were deployed to quell any further unrest.