Media playback is unsupported on your device Media caption Archive: Orla Guerin reports on Dr Afridi's jailing in May 2012

Officials in Pakistan have overturned the jail sentence and ordered a retrial of a doctor who helped the CIA in their search for Osama Bin Laden.

Shakil Afridi was charged with treason and tried under the tribal justice system for running a fake vaccination programme to gather information.

He was jailed for 33 years in May 2012 and has been held since then at Peshawar Central Jail.

Bin Laden was killed by US forces in Abbottabad in May 2011.

His killing created a crisis in relations between the US and Pakistan, which felt the covert operation was a violation of its sovereignty.

His cousin, Qamar Nadeem Afridi, told the BBC it was a "great development" and said the "true facts" would now come out.

Although Dr Afridi's conviction has been overturned, his retrial will still be heard under tribal jurisdiction in a closed court.

The BBC's M Ilyas Khan in Islamabad says there is no guarantee that a similar verdict will not be reached.

What Dr Afridi did angered many Pakistanis and to release him would be politically very damaging, our correspondent says.

Jailed for collaboration

The sentence was quashed and a retrial ordered because the previous judge had exceeded his authority in handing down the sentence, a judicial official hearing Dr Afridi's appeal heard.

The previous trial had been heard by an official with the status equivalent to a magistrate. The order issued by the commission says that the new trial must be heard by a more senior official, the political agent of Khyber tribal agency, who has the status of a judge.

Dr Afridi will stay in prison until the retrial is concluded. No date has been set for the trial but his lawyer says he will submit a request for an early trial, Reuters news agency reports.

Shortly after the raid on Bin Laden's house, Dr Afridi was arrested for conspiring against the state of Pakistan.

Although he was accused of working with the CIA he was eventually jailed for collaborating with a militant group. Correspondents say that the group named had actually kidnapped him on one occasion.

Dr Afridi was not present at his trial. His swift conviction came in a court outside Pakistan's normal jurisdiction in the semi-autonomous tribal areas, which do not necessarily follow standard judicial procedures.

He has consistently maintained that he did not know the target of the CIA operation was Osama Bin Laden.

US officials spoke out against his arrest and sentencing and called for his release. But Pakistan maintained that any government would have taken similar measures.

'Speaking out'

A few months after his conviction Dr Afridi managed to speak to Fox news from his jail cell via a smuggled phone.

He said that he had no idea who the specific target of the operation was: "I didn't know about a specific target apart from the work I was given to do" .

He also revealed that after his arrest he was blindfolded for eight months and handcuffed for a year in a prison beneath the ISI headquarters in Islamabad.

"I had to bend down on my knees to eat with only my mouth, like a dog," he said.

He also claimed to have been tortured with cigarette burns and electric shocks during his interrogation.

There has been no official response to Dr Afridi's allegations, but Pakistani officials denied allegations that emerged weeks later that he was on hunger strike at his jail in Peshawar.