David James' daughter Julie speaking after the ruling from the Supreme Court.
One of the Supreme Court Justices, Lady Hale, said the appeal was dismissed but the James' family had "won the argument" on "principle".
"Decision-makers must look at his welfare in the widest sense, not just medical but social and psychological," she said.
"They must consider the nature of the medical treatment in question, what it involves and its prospects of success; they must consider what the outcome of that treatment for the patient is likely to be.
They must try and put themselves in the place of the individual patient and ask what his attitude to the treatment is or would be likely to be and they must consult others who are looking after him or interested in his welfare, in particular for their view of what his attitude would be.
"In my view, therefore, Mr Justice Peter Jackson was correct in his approach."
But she added: "However, in my view, on the basis of the fresh evidence which was before them, the Court of Appeal were correct to allow the appeal and make the declarations they did.
"There had been such a significant deterioration in Mr James' condition that the prospect of his regaining even his previous quality of life appeared very slim. The risk that cardiovascular resuscitation would make matters even worse appeared great.
"The time had indeed come when it was no longer premature to say that it would not be in his best interests to attempt to restart his heart should it stop beating.
"Indeed, had the judge been asked to reach a decision on the basis of the evidence then available, it seems clear on the basis of his reasoning that he would have done the same. "
David James' family said they are "very pleased" with today's Supreme Court ruling, despite losing their appeal, because the court said their argument was correct in principle.
– Spokesman, Aintree University Hospital
The Trust is pleased that the decision of the Court of Appeal has been upheld. It is clear that decisions surrounding best interests in some complex cases remain a difficult balancing exercise.
This was an emotional but important case for all involved.
The outcome does not detract from our sincere condolences to Mr James’ family for their loss.
The Supreme Court has ruled that appeal judges were right to allow doctors to withhold treatment from a "gravely ill" man from Liverpool
David James, 68, died 10 months ago shortly after the Court of Appeal decided that withdrawal of treatment would be in his best interests.
His widow May had asked the Supreme Court - the highest court in the UK - to overrule that decision.
But a panel of Supreme Court justices today ruled against Mrs James after analysing the case at a hearing in London in July.
Doctors at Aintree University Hospitals NHS Foundation Trust in Liverpool initially asked a High Court judge sitting in the Court of Protection for a declaration that withholding treatment would be in Mr James's best interests should his condition deteriorate.
Mr James's relatives were against the idea and Mr Justice Peter Jackson refused the trust's application.
But his decision was overturned by the Court of Appeal after the trust appealed.
The Supreme Court heard that Mr James - a grandfather and father of three - had undergone surgery for colon cancer.
Mrs James said Mr Justice Peter Jackson's decision was right and suggested that the Court of Appeal ruling undermined the "protection" given by "legal presumption in favour of preservation of life".
Trust bosses said the appeal court was right. Bosses say Mr James was "critically ill and steadily deteriorating".
They say he had been in an intensive care unit for seven months and had a range of problems, including multi-organ failure.
The Court of Protection, which is part of the High Court, analyses issues relating to sick and vulnerable people.
The Supreme Court has ruled doctors were right to withhold treatment from a Liverpool man.
David James, 68, died after spending more than six months in intensive care at Aintree Hospital.
The widow of a man from Liverpool at the centre of a right to life battle hopes the supreme court will overturn a decision that allowed doctors to withhold treatment from him.
David James died after spending more than six months in intensive care at Aintree Hospital.
The Supreme Court will rule in the case of a man whose family challenged doctors who wanted to withhold further treatment.
David James from Liverpool died after spending more than six months in intensive care.