US officials have hailed Mr Afridi as a hero for helping pinpoint bin Laden's location before the secret May 2011 raid by US special forces in Abbottabad, Pakistan, after more than a decade of searching.
Judicial official Sahibzada Mohammad Anees ordered a new trial on the grounds another official had exceeded his authority when handing down last year's sentence. Mr Afridi remains in custody.
The written judgment by Mr Anees said: "The assistant political agent did not have the authority to award 33 years' imprisonment to Dr Shakil Afridi. He played the role of a magistrate for which he was not authorised."
A political agent and his assistant are representatives of the Pakistani government in the tribal areas that are not covered by the country's judicial system.
Mr Afridi's sentence further damaged ties between Pakistan and the US when they had already been strained over the bin Laden raid.
Pakistani officials were outraged by the bin Laden operation, which led to international suspicion they had been harbouring al Qaeda's founder.
In their eyes, Mr Afridi was a traitor who had collaborated with a foreign spy agency in an illegal operation on Pakistani soil. Officials in Washington, meanwhile, have called for Mr Afridi to be released.
Angry US senators symbolically withheld £25 million in aid from Pakistan in retaliation for the jail term.
Relations since then have slowly improved but there remains plenty of residual distrust on both sides.
The doctor's lawyer, Samiullah Khan, welcomed the decision to order a retrial, saying: "I think it is a good achievement for us."
He called the original decision to sentence Afridi to 33 years in prison "totally illegal".
But Mr Khan said he was concerned about the decision to once again hold the trial under rules governing the tribal areas.
He would rather the case be heard by a judge under Pakistan's normal legal system.
Mr Khan said he had not been able to share the news with his client. The doctor has been held in prison with little contact to the outside world and his lawyer said it had been months since he had seen his client.
The lawyer said he had informed Mr Afridi's brother who was "very happy with the decision".
Mr 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 and kill bin Laden.
Pakistani officials initially said Afridi would be tried for treason for helping the US but court documents showed he was jailed for being a member of a militant group, Lashkar-e-Islam.
Mr Afridi denied the charges and a spokesman for the group said they had no ties with him.
Mr Afridi's lawyer said: "Shakil was himself kidnapped by militants. He had to pay a lot of money for his release. There is no question a person like him would treat militants or give them funds."
The doctor's new trial will be conducted under the auspices of the political agent of Khyber Agency, Mr Anees, who is a commissioner with responsibility for law in Pakistan's tribal areas, said in his statement.