An order from the Pakistan government preventing former military ruler Pervez Musharraf from travelling abroad has been struck down by a court.
Under the ruling by the Karachi court, the government still has 15 days during to appeal against the decision.
This means Mr Musharraf, who is facing treason charges, can not leave the country immediately.
The ruling could pave the way for the man who ruled Pakistan for nearly a decade to leave the country after an embarrassing trial that saw him become the first chief of army staff to face treason charges.
It also puts the Pakistani government, whose decision to push for Mr Musharraf's trial put it at odds with the powerful military, in a tricky position where it must decide whether it wants to further anger the military by trying to stop Mr Musharraf from leaving the country.
The court gave no reason for striking Mr Musharraf's name from the exit control list, which prevents people from leaving the country, usually in legal cases.
The 70-year-old ousted then-prime minister Nawaz Sharif's government in 1999.
Mr Musharraf resigned as president in 2008. He later left the country, but returned to Pakistan in March 2013, hoping for a political comeback.
Instead, he got embroiled in court cases, including the treason charges which are connected to his decision in 2007 to declare a state of emergency and detain senior judges, including the chief justice.