A British-born militant sentenced to death for the murder of American journalist Daniel Pearl was ordered to be let out of prison Thursday by Pakistan's Supreme Court in the latest twist to a legal saga spanning nearly two decades.

The court said, however, that Ahmed Omar Saeed Sheikh should remain in custody in accommodation similar to that given to prison staff while another appeal is considered.

Sheikh and three accomplices have been behind bars since 2002 when they were convicted of the kidnapping and murder of Pearl -- at the time the South Asia bureau chief for the Wall Street Journal.

Since then they have won and lost a series of appeals and counter-appeals in connection with the case, with a top court last year overturning their murder convictions.

That decision meant they had completed their sentences on the kidnapping charge, and the court in January ordered them to be released.

They were kept in custody, however, as the provincial and federal governments -- as well as Pearl's family -- launched another petition to keep them behind bars.

On Thursday, the court said they should be confined to prison staff accommodation during the process.

"We are not satisfied with the continuous detention of this person," Justice Umar Ata Bandial told the court.

"The detainee Ahmed Omar Saeed Sheikh shall be accommodated in a government building in which officers of jail reside."

Lawyers said Sheikh will likely be transferred from Karachi to Lahore, his ancestral home.

It was not immediately clear when the judges would make a final ruling on the case proper, or if prosecutors have exhausted all avenues of appeal.

Ahmed Omar Saeed Sheikh, pictured here in 2002, was originally sentenced to death for the murder of journalist Daniel Pearl
Ahmed Omar Saeed Sheikh, pictured here in 2002, was originally sentenced to death for the murder of journalist Daniel Pearl AFP / Aamir QURESHI

The case has caused enormous friction between Islamabad and Washington despite officials in both capitals being convinced of Sheikh's complicity in Pearl's death.

At his original trial, the now 47-year-old did not deny being behind the plot to kidnap the American, but said he was not responsible for his brutal beheading, which was filmed and broadcast on the internet.

In a transcript released by the Pentagon in 2007, Khalid Sheikh Mohammed -- one of Osama bin Laden's most trusted lieutenants and the alleged mastermind of the September 11 attacks -- told a military tribunal in Guantanamo Bay that he had slit Pearl's throat.

He is still in US custody awaiting trial on myriad charges that carry the death penalty.

Omar Sheikh was born in London to middle-class Pakistani immigrant parents and attended private schools before starting a degree at the London School of Economics.

But the hulking 1.9-metre-tall (six feet two inches) amateur boxer dropped out in his first year and began delivering aid to support Muslims besieged by Serbs during the Bosnian war in the 1990s.

In his biography "In the Line of Fire", former Pakistan military chief and president Pervez Musharraf said Sheikh had been recruited by Britain's MI6 spy agency, but went rogue after becoming radicalised when he moved to Pakistan.

In 1994, posing as a Hindu in Indian-ruled Kashmir, Sheikh arranged the kidnapping of four foreign tourists to demand the release of jailed Islamic militants.

He was captured in a shootout and imprisoned in New Delhi, but freed in a hostage exchange in 1999 when militants hijacked an Indian Airlines flight and forced it to land in Kandahar, Afghanistan.

He lured Pearl to his death in Karachi by pretending to be a media-friendly intermediary with access to extremists.

Pearl's widow Mariane, a French journalist, wrote a book of her husband's life titled "A Mighty Heart", which was turned into a movie co-produced by Brad Pitt and starring Angeline Jolie.

Washington has previously asked Pakistan to hand Sheikh to US authorities if he is ever freed.