Shakil Afridi was arrested after US troops killed the terror leader in May 2011 in Abbottabad, where Afridi had set up a fake vaccination programme in the hope of obtaining DNA samples to identify the al-Qaeda leader.

He was convicted in 2012 for treason over alleged ties to militant group Lashkar-e-Islam and not for working for the CIA, for which the court said it did not have jurisdiction.

But angry US lawmakers saw the sentence as retaliation for his role in bin Laden’s capture, and last year threatened to freeze millions of dollars in vital aid to Islamabad.

Dr Afridi was found guilty under the tribal justice system of Khyber district, part of Pakistan’s semi-autonomous tribal belt. He was also fined 320,000 rupees ($3,500).

The appeal, filed by Afridi’s brother Jamil through lawyers, said the allegations were “false, concocted and without foundation”.

On Thursday, Afridi’s lawyer told AFP: “The Commissioner of Peshawar has set aside the decision of the Assistant Political Agent of Khyber agency and ordered the retrial.”

A government source who was present during the appeal hearing in the office of Peshawar’s Commissioner confirmed the account. “The Commissioner after hearing the appeal by Doctor Shakil Afridi has ordered the retrial,” the official told AFP on condition of anonymity.

Samiullah Afridi, the defence lawyer, said he argued that the Assistant Political Agent was not authorised to pass such a long sentence, no proper trial was held and his client was not given an opportunity to defend himself.

Afridi was not present in the court during his trial and could not argue in his own defence, officials said after his conviction. Under the tribal system, he would not have had access to a lawyer.

The appeal also said Afridi had “no association” with Lashkar-e-Islam, according to a copy obtained by AFP. Lashkar-e-Islam, led by warlord Mangal Bagh, is widely feared for kidnappings and extortion in the tribal district of Khyber, where Afridi worked for years.

The appeal, filed on June 1, 2012, said Afridi was kidnapped by Lashkar-e-Islam in 2008 and ordered to pay one million rupees ($10,660).

The tribal court had said that Afridi paid two million rupees to the faction and helped to provide medical assistance to militant commanders in Khyber. The militants have denied any links to Afridi, saying they fined him for overcharging patients, and have threatened to kill him.

Troubled ties between the United States and Pakistan have not recovered since they sank to all-time lows after the killing of bin Laden by US commandos in a raid on his compound. Then-Secretary of State Hillary Clinton denounced Afridi’s treatment as “unjust and unwarranted”.

Pakistan reacted furiously to what it called a violation of its sovereignty over the attack. It insisted it knew nothing about bin Laden’s whereabouts.