Pakistan on Thursday overturned a 33-year jail term handed down to a doctor who helped CIA agents find al Qaeda leader Osama bin Laden, a decision which may result in a new trial.
Shakil Afridi, hailed as a hero by US officials, was arrested after US special forces killed bin Laden in May 2011 in the town of Abbottabad in a secret raid that outraged Pakistan and strained relations between the strategic allies.
Afridi's conviction in 2012 further soured the atmosphere. US senators withheld $33 million in aid in retaliation.
Pakistani officials initially said Afridi was charged with treason for helping the United States, but court documents showed he was jailed for being a member of a militant group, Lashkar-e-Islam.
On Thursday, senior judicial official Sahibzada Mohammad Anees overturned the ruling on the grounds that another official had exceeded his authority when handing down 2012 sentence.
"The assistant political agent ... did not have the authority to award 33 years' imprisonment to Dr Shakil Afridi," said a written judgment. "The assistant political agent played the role of a magistrate for which he was not authorised."
Afridi was not present at Thursday's hearing in the city of Peshawar and remains in custody. A political agent and his assistant are representatives of the Pakistani government in the semiautonomous tribal areas, which are not covered by the country's judicial system.
Afridi was accused of running a fake vaccination campaign, in which he collected DNA samples, that is believed to have helped the American intelligence agency track down bin Laden.
Relations between Pakistan and the United States have since slowly improved but residual distrust lingers.
A new trial would raise the prospect of his release but if he were freed, Afridi would probably have to leave Pakistan. Militant groups have long threatened to kill him, and Pakistani authorities have said they fear for his life even in jail.
Lawyer Samiullah Afridi said Afridi planned to submit an application for an early hearing. He will also be allowed to use lawyers in the next trial, a legal privilege he was previously denied. Afridi has denied the charges against him and a spokesman for the group said they had no ties with him.
"Shakil was himself kidnapped by militants," Afridi's lawyer told Reuters. "He had to pay a lot of money for his release. There is no question that a person like him would treat militants or give them funds."
The review of Afridi's case will be conducted under the auspices of the political agent of Khyber Agency who is trained as a judge, Anees said in his statement. It will be up to the agent to decide whether a new trial is needed.
Anees is a commissioner with responsibility for law in Pakistan's tribal areas, which are governed by colonial-era legislation known as the Frontier Crimes Regulation.
"An order for a re-trial implies a judgment on the quality of the earlier order, not just on the authority of the officer who gave the order," said lawyer Ahmer Bilal Soofi, an expert in the Frontier Crimes Regulation.
"The judicial official could have reduced his sentence, if that was the problem. But he did not. He overturned the entire order."