Honeymoon murder suspect Shrien Dewani has lost a High Court bid to block his extradition to South Africa until he is fit to stand trial.
A panel of three judges, headed by Lord Chief Justice Lord Thomas, ruled that it would not be "unjust and oppressive" to extradite him if an undertaking was given by the South African government relating to how long he would be kept in the country without trial.
The court heard today that the government indicated it was willing to give that undertaking.
Dewani, from Bristol, has been fighting removal from the UK to face proceedings over wife Anni's death until he has recovered from mental health problems, including depression and post-traumatic stress disorder.
Dewani, who is compulsorily detained in hospital under the Mental Health Act, is accused of ordering the killing of his new wife Anni, 28, who was shot as the couple travelled in a taxi on the outskirts of Cape Town in November 2010.
His lawyers have stressed at various hearings that he will be willing to defend himself at trial once he is fit to do so, but they say he is unfit to plead under English law and his "prognosis is not certain".
Today's ruling followed a hearing at the High Court last year. Those proceedings took place after an earlier decision that there were outstanding legal issues which needed to be decided.
Last July, chief magistrate Howard Riddle ruled at Westminster Magistrates' Court that Dewani should be extradited and rejected his attempt to stay in the UK for further hospital treatment.
He said Dewani was not fit to plead or stand trial at present, but there was evidence that he would receive the care he needed in South Africa.
Judge Riddle originally gave the go-ahead to Dewani's extradition in 2011 but had to reconsider the position after the High Court later allowed an appeal.
The High Court proceedings centred on two legal issues - the first relating to Dewani's status as ''an accused person'', and the second concerning whether it would be ''unjust and oppressive'' to extradite him ''regardless of the prognosis'' of his mental condition.
The judges were asked to decide whether a person who is unfit to plead is "an accused" for the purpose of the Extradition Act 2003 "if he is being extradited in circumstances where he may remain unfit to plead".
They were also asked to rule on whether it was "unjust or oppressive to extradite a person who is agreed at the time of the determination to be unfit, whatever the prognosis".
So far three men have been convicted over Mrs Dewani's death.
South African Xolile Mngeni was convicted of premeditated murder for shooting her. Prosecutors claimed he was a hitman hired by Dewani to kill his wife, which Dewani has consistently denied.
Taxi driver Zola Tongo was jailed for 18 years after he admitted his part in the killing and another accomplice, Mziwamadoda Qwabe, also pleaded guilty to murder and was handed a 25-year prison sentence.
Dewani's family have said that he remains committed to returning to South Africa ''when his health would permit a full trial and when appropriate protections are in place for his health and safety''.
A lawyer for the South African government said it was "delighted" with the court's ruling and expected it would be able to give the undertaking, but needed 14 days "for final clarification".
Lord Thomas said: "It might be unjust and oppressive to order the return of a person who was agreed to be currently unfit and where there was a prospect that he might remain permanently unfit without considering whether an undertaking should be required from the requesting state."
He added: "The circumstances of this case are such that we consider, on the findings made by the district judge, it would be unjust and oppressive to return him without such an undertaking."
The effect of the undertaking would be that "in the event of the appellant (Dewani) being found unfit to be tried, he will be free to return to the UK, unless there is found to be a realistic prospect of his being tried with a year - or other stated reasonable period - of that finding and the trial takes place within the period".
Lord Thomas continued: "In any event the appellant must be free to return in the event a court in South Africa, having found him unfit to be tried, embarked on the process of determining under the Criminal Procedure Act 1977 whether he did the act."
He concluded: "If such an undertaking was given, then it would not be oppressive or unjust."
Amit Karia, a first cousin to Anni, said on behalf of family members at London's High Court: "We are happy with the judgment. We have waited for it for three years, three months."
He said: "It seems a step closer to finally getting justice for our Anni."
But he warned there was still a possibility that Dewani could launch a last-ditch appeal over today's ruling to the Supreme Court, the highest court in the land.
Mr Karia said: "We are always worried and don't take anything for granted."
He described the situation for Anni's parents as "immensely difficult - they do not have normal life any more."
He added: "They just want the truth - that is all we have ever wanted."