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.
US President Donald Trump said on Thursday he had agreed to reduce tariffs on China to 47 per cent in exchange for Beijing resuming US soybean purchases, keeping rare earths exports flowing and cracking down on the illicit trade of fentanyl.
Israeli planes and tanks pounded areas in eastern Gaza on Thursday, Palestinian residents and witnesses said, a day after Israel said it remained committed to a US-backed ceasefire despite launching more lethal bombardments in the territory.
Police have arrested five more suspects linked to the theft of treasures worth $102 million from the Louvre museum's Apollo gallery, the Paris prosecutor said on Thursday, expressing hope the latest developments will help them find the jewels.
Afghanistan and Pakistan will restart peace talks in Istanbul, three sources familiar with the matter said on Thursday, a day after Islamabad said the discussions had ended in failure.
Israeli airstrikes on Gaza have killed at least 104 people on Wednesday, according to Gaza health authorities, with Israel stating they remain committed to the US-backed ceasefire.