However, the father changed his mind after hearing medical evidence which suggested it would be in the best interests of the child if medical support was withdrawn.
Lawyers for the health authority caring for the baby in intensive care told Mr Justice McFarlane: "All of the parties in court now agree that it would be in RB's best interests for the course suggested by the doctors to be followed."
The judge welcomed the decision, describing it as a "sad, but in my view inevitable outcome".
He said: "From the moment of the baby's birth it was apparent he was profoundly unwell."
Mr Justice McFarlane said it would now be lawful to withdraw life support from the child.
Tribute to parents
He also paid tribute to the parents, who he said had acted in an exemplary manner.
He 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."
Both parents were in tears as the judge summed up the case, and the mother at one point left the court, but later returned.
A joint statement issued by lawyers representing RB's parents and the hospital trust said: "Although RB's parents separated, they have always been united in wanting the best possible care for their son so that he may have the very best possible quality of life.
"They have been at his bedside daily these last 13 months.
"The court has heard that RB is a dear little boy, adored by his parents, family and the hospital staff.
"Every party in this case has reached this agreement after careful, considered thought for what is in RB's best interests."
The statement said the decision to withdraw life support from the child had been "agonisingly difficult".
"RB's parents would now wish to spend what little time remains with their beloved son."
Baby RB is thought to have a condition called congenital myasthenic syndrome (CMS), which severely limits the ability to breathe independently and limb movement. He has been in hospital since birth.
The hospital's legal team argued during the hearing that the baby faced a "miserable, sad and pitiful existence" - even if tracheotomy surgery to relieve his breathing difficulties allowed him to return home.
They were particularly concerned that the child could not communicate whether treatment - such as regular suctioning of his airways to remove fluid - caused him pain.
Several experts told the hearing that the child was too profoundly disabled to enjoy any quality of life.
But lawyers for the father argued the baby's brain was unaffected, and that he could see, hear, feel and recognise his parents.
The hearing also heard evidence that he was able to play with toys.
For legal reasons, none of the parties in the court case can be identified.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.