The family of an elderly devout Muslim who is in a minimally conscious state have lost their legal bid to prolong his life. They argued that the 72-year-old man, who can be identified only as VT, would regard his suffering as bringing him closer to God.

The family contested an application by an NHS Trust that it was not in VT's best interests for him to be given intensive resuscitation or be admitted to intensive care if his condition deteriorated.

But Mr Justice Hayden, at the court of protection in London, said the Trust could withhold treatment. To prolong life in VT's case would "effectively be restarting a life which has stopped", he said.

For 10 years, VT had endured the after-effects of a stroke as well as diabetes, hypertension and kidney disease. He could walk a few steps with a frame but was housebound and needed help from his family with all aspects of living.

"It is obvious it has not been in any way burdensome to them. To my mind they have regarded it as a privilege and an opportunity to show how their father is loved by the whole family. I have no doubt that over the last decade, the family have enabled the father to live a rich and happy life despite his circumstances."

But in May 2013, after a bout of pneumonia, VT suffered a cardiac arrest. His eldest son gave him CPR until the ambulance arrived. It was remarkable that VT survived after his collapse, said the judge, who added that he was satisfied that VT's family were consulted about a DNR (Do Not Resuscitate) order that was subsequently placed on his notes.

The court had heard from three specialists who concluded that VT had sustained a very severe brain injury and had no prospect of any meaningful recovery.

If VT was suffering, as seemed likely, the family wanted his suffering continued by active intervention, preserving if necessary only a flicker of life, because they believed he would want every effort made to preserve his life, however compromised. They felt that to deprive him of the opportunity to suffer was to deprive him of the chance to purify himself before death.

The judge said: "It would be quite extraordinary if his family were misrepresenting the father's view. They have showered him with love and care for 10 years, showing a loyalty which is, in my view, inspiring.

"His right to, if necessary, suffer for his faith, has not always been understood and has at times been unwittingly denigrated. Their actions are not unkind if they truly represent VT's own wishes, as I believe they do. Indeed, in an increasingly secular society, it takes great courage to assert strong religious belief."

He added: "In the white heat of intensive care, the priority will always be the patient's physical welfare, and so it should be, but the family are intent that I should consider him not only as a raft of complex medical problems but more broadly as the man he has been throughout his life and, on some level, they consider he still is – his morality, his faith, his ethics and his religious beliefs.

"They are right to ask me to do this. Indeed, I believe that VT's wishes and feelings are one of the most important of the factors that I should have regard to, although they are not, and I emphasise, determinative."

Granting the application, he said that bag and mask resuscitation was excluded from the declaration sought, but CPR was not in VT's best interests, and to require staff to treat him in intensive care would be entirely futile.

"It would not be prolonging life. it would effectively be restarting a life which has stopped. I hope that when death comes for him, whenever that may be, it will come peacefully, and he will be with his family."

After the ruling, the family's solicitor, Zak Golombeck from law firm Pannone, said it would have "major repercussions for people of faith throughout the country".

"The judge accepted the deeply held religious beliefs of VT and his family, but held that in spite of these beliefs the opinions of the clinicians regarding VT's best interests should take precedence.

"It is for this reason we are carefully considering the judgment and will be advising our client as to any potential appeal."