The father of a baby with a rare genetic condition has withdrawn his opposition to a legal plea by doctors and the boy's mother to switch off his life support.

The one-year-old, known only as RB, suffers from congenital myasthenic syndrome, which has left him with little muscle control and on a ventilator since an hour after his birth.

Medical staff at the NHS hospital where he is being treated want to turn off the baby's life support and let him die, saying RB is consigned to leading "a miserable , sad and pitiful existence". His mother has supported their application.

But the boy's father had been fighting the high court action, saying everything possible should be done in an attempt to prolong the boy's life, suggesting that a tracheostomy – creating an opening in his neck to help air to his lungs – might enable him to be cared for at home.

But the father's change of position came on the seventh day of an emotionally charged hearing at the family court in which the judge had to decide whether the chronically disabled baby should be allowed to live or die after withdrawal of ventilation.

The judge made an order that RB's parents and the trust should now make arrangements to bring the baby's life to "a dignified end".

Lawyers for the health authority caring for the baby in intensive care told Mr Justice McFarlane that all parties in court now agreed that it would be in the boy's best interests for the course suggested by the doctors to be followed.

The judge said such a course, with palliative care, would be lawful, and paid tribute to the boy's now separated parents who had been "exemplary" in attending their son's hospital bedside every day during his short life.

It was a "sad but in my view inevitable outcome" and the "only tenable one for RB", he said.

Both parents wept and the mother at one point left the court in tears.

The hospital authority had sought a court order allowing RB to die with dignity rather than continuing to live what doctors described as a "miserable and pitiful" existence.

The father initially opposed the application, arguing his son showed signs of "purposeful" movement when presented with toys and should have the chance to live, though chronically disabled.

Expert medical witnesses described RB as having a normal brain locked inside an immobile and "non-communicative" body.

They were concerned he was unable to show, by facial expression or bodily movement, when he was in pain during the stressful treatment he had to undergo, including regular suctioning of his airways to remove fluid.

The court heard from counsel that it was a decision the father, AB had come to "after a very great deal of thought after hearing all the evidence as it has developed in this case".

A joint statement later issued by lawyers involved in the case added: "This has been an agonisingly difficult decision. RB's parents would now wish to spend what little time remains with their beloved son."

The judge said: "It is, I suspect, impossible for those of us to whom such an event has not happened to do more than guess at the impact of it upon these two young parents.

"In one moment all of the hopes and dreams that they will have had for their expected baby will have been dashed and replaced with a life characterised by worry, stress, exhaustion, confusion and no doubt great sadness."

He said: "During the past 13 months both KM and AB have discharged their responsibility to their son in a manner which has been described by all who have seen it in superlative terms."

The judge went on: "It is a fact that K and A have spent the most part of each and every day of the last 13 months at RB's bedside, doing what they can to care for him and, when the opportunity arises, to interest and stimulate him, seizing upon any sign of a spark and trying to develop it into something more.

"They have put their own adult lives on hold. The stress has been immense, it has cost them their relationship but still they work together and do what they can to support their son.

"When faced with the awfulness of the situation in which they found themselves, these two young people have stepped up to the plate and discharged the responsibility that life had thrust upon them by each showing 100% commitment to their child in a manner which can only command profound respect and admiration."

The judge said he had "total confidence" that RB's parents and the medical team had done all they could to make his life "as viable, comfortable and enjoyable as it could be".

An anonymity order protecting the identities of the parents, hospital trust and health professionals caring for the boy remains in force.