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.
Kuwaiti air defences were intercepting missile and drone attacks of undisclosed origin, state media reported, while in Bahrain sirens sounded and residents were urged to seek shelter after US and Iran exchanged fire.
The US government will attempt to redirect Iranian assets to Gulf states for rebuilding and repairs of damage caused by Iran, a source familiar with the matter said, as Tehran followed up a wave of strikes against Kuwait and Bahrain with further drone launches.
An Israeli strike killed at least seven Palestinians including two women in Gaza on Saturday, health officials said, as mediators restarted talks in Cairo with Hamas and other factions over safeguarding a strained ceasefire agreement.
Israeli forces killed a seven-month-old Palestinian baby and wounded his parents in the Tel Rumeida area south of the West Bank city of Hebron on Friday evening, the Palestinian health ministry said.