Pakistan's Supreme Court on Thursday ordered the release of former Prime Minister Imran Khan after terming his arrest unlawful.
The country's top court also directed Khan to appear before the Islamabad High Court (IHC) tomorrow, adding that he will have to abide by whatever decision the IHC gives.
Khan, who heads the Pakistan Tehreek-e-Insaf (PTI) party would spend the night in the same police guest house as before but allowed to meet a limited number of friends and family.
It was not immediately clear when he would be allowed to go home.
The latest orders were issued by a three-judge bench, headed by Chief Justice Umar Ata Bandial.
"The Supreme Court reversed all legal proceedings against Imran Khan ... he has been asked to present himself in the Islamabad High Court on Friday morning," lawyer Babar Awan told reporters.
Awan added that the court had ruled that Khan was now under its custody and not the anti-graft agency.
Imran Khan's detention on graft allegations has ignited deadly protests and a tussle with the country's powerful military.


Five dead at Russian nuclear arms research facility after ammunition explosion
King Charles unveils 'human-centered' AI principles with tech giants
Philippines' Duterte takes the stand in 'politicised' impeachment trial
Hong Kong court finds three guilty of model's gruesome murder
At least 62 killed in Indonesia's Papua riots since Tuesday, police say
India's parliament approves landmark bill to expand legislatures
US senators grill Nvidia CEO over affair with alleged Chinese spy, national security risks
Mexico detains 13 public servants, probes links to organised crime
