Home secretary Theresa May has laid out the next steps she intends to take in her ongoing struggle to deport radical cleric Abu Qatada.
On Tuesday the Court of Appeal ruled the government could not take the case to the Supreme Court, in yet another blow to May.
Speaking in the House of Commons on Wednesday, May said: "The prospect of deportation now depends on one very narrow issue, whether or not evidence obtained by torture would be used against him."
May detailed the government's "twin strategy".
Firstly the government intends to bypass the decision by seeking an appeal directly from the Supreme Court itself.
Secondly, she will continue to work with Jordan in order to establish a legally binding treaty guaranteeing Qatada would not face evidence that might have been obtained by torture.
The home secretary has signed a "mutual legal assistance agreement" with Jordan, in order to launch a fresh deportation bid.
It must be ratified by both countries before it is formalised.
The new agreement includes a number of fair trial guarantees, May said, which would apply to anyone being deported from either country.
May said: "I believe these guarantees will provide the courts with the assurance that Qatada will not face evidence that might have been obtained by torture in a retrial in Jordan.
"I believe that the treaty we have agreed with Jordan - once ratified by both parliaments - will finally make possible the deportation of Abu Qatada.
"But as I have warned the House before, even when the treaty is fully ratified, it will not mean that Qatada will be on a plane to Jordan within days.
"We will be able to issue a new deportation decision, but Qatada will still have legal appeals available to him, and it will therefore be up to the courts to make the final decision.
"That legal process may well still take many months, but in the meantime I believe Qatada should remain behind bars."
Shadow home secretary, Yvette Cooper, welcomed the government's efforts to deport the cleric but said "serious questions remained" over the process so far.
Cooper described the catalogue of errors that had prevented the government from deporting Qatada including the infamous appeal deadline blunder last year.
In a sign of the lengths being considered to take the case forward, Downing Street confirmed on Tuesday morning that David Cameron was looking at temporarily withdrawing from the European convention on human rights (Echr).
May said: "We should have all options - including leaving the convention altogether - on the table. The prime minister is looking at all the options. That is the only sensible thing to do."
Qatada has been subject to some form of detention either house arrest or prison since 2003.
His deportation has been a constant thorn in May's side since becoming home secretary and risks becoming the case that defines her time in government.