Darren and Debbie Wyatt, from Portsmouth, who are today celebrating Charlotte's second birthday, were at the High Court in London for the ruling given by Mr Justice Hedley.
They had asked the judge to discharge his year-old declaration that doctors would not be acting unlawfully if they decided it was not in the child's best interests to artificially ventilate her in a life-threatening situation.
Reading out a detailed ruling in the case today the judge said he had come to the view that "at least at present no further declaratory relief is required".
Mrs Wyatt, 24, who is heavily pregnant with the couple's fourth child, and her husband Darren, 33, say that the condition of their daughter has improved to such an extent that she has now "crossed an invisible line", meaning that the use of artificial ventilation in certain circumstances would be justified.
A statement issued on the couple's behalf stated: "Darren and Debbie are very happy that the order what has been hanging over Charlotte for over a year now has been lifted as this has caused a huge strain on their lives".
Despite the gloomy prognosis last year, Charlotte survived against the odds and medical opinion, and is said to have made "remarkable progress" despite serious brain, lung and kidney damage.
She weighed just one pound and was only five inches long when she was born three months prematurely at St Mary's Hospital in Portsmouth.
Mr Justice Hedley said: "Having set out my views and having recognised, perhaps to my regret, that I simply cannot preclude future litigation, I have come to the view that at least at present no further declaratory relief is required.
"I hope that the trust and confidence of which both Dr K (Charlotte's consultant who cannot be named for legal reasons) and the parents spoke can now develop with a view to securing the best for Charlotte, whether in life or death.
"It is said that cases like this have no winners, but here there is a chance that Charlotte may be the winner if her parents seize this opportunity constructively to build upon their trust and confidence in Dr K and the staff who have committed themselves in such exemplary fashion to her case."
David Wolfe, counsel for the couple, told the judge: "The parents are most grateful for the opportunity to restore the normal parent-doctor relationship in this case.
"I am formally instructed to say on behalf of Charlotte 'thank you', remembering that it is Charlotte's second birthday today.
The judge replied: "Indeed, I am aware that people are heading off to the birthday party and I was going to ask them to convey whatever they can to say other people of thinking of her."
Afterwards, a statement issued on the couple's behalf, said they "are so happy that they can now get on with their lives and look forward to the future and look forward to Charlotte's homecoming and the birth of their other child".
It continued: "They would like to thank all the public for all their support and prayers and would like to thank the judge for lifting the order, especially on her birthday as they believe this is the best present that Charlotte could have.
"Now she can continue to get on with her life and progress and come home."
Although the judge formally lifted the existing declarations, he stressed that that doctors could not be compelled to act against their conscience.
Mr Justice Hedley said: "I have tried to set out, in a way comprehensible to all, what I understand to be both the duties and also the limits on the duties of the treating clinician.
"He does not take orders from the family any more than he gives them.
"He acts in what he sees as the best interests of the child: no more and no less.
"In doing so, however, parental wishes should be accommodated as far as professional judgment and conscience will permit, but no further. It is vital that that is understood by all."
A dispute that "encroaches on conscience will be rare indeed, but I can see that it could happen here".
Afterwards, David Locke, counsel for Portsmouth Hospitals NHS Trust, said: "The judge has backed comprehensively the doctors' assessment of the position and has explained the doctors' rights to treat Charlotte in the way they consider correct and not to have to follow the instructions of the parents in the event that what they have been asked to do is against the doctors' conscience.
"He has explained what conscience means and how in the circumstances the doctor has described - where the parents might wish her to be ventilated - the doctors would be entirely justified, and indeed compelled, not to ventilate her, because it would not be in Charlotte's best interests.
"In those circumstances, having defined the areas where the doctors can deliver their duty to Charlotte, the judge has given very clear guidance for the doctors to give them the ability to deliver the best possible care for Charlotte in an emergency.
"So this is precisely the judgment we asked the judge to give."
He said that the really important part of the ruling was where the judge had indicated that if there were future complaints to the police or the General Medical Council about the treating doctors, the regulatory authorities should be very cautious in their response.
He said: "The doctors are, as they always have been, required to treat Charlotte in the way that they consider to be in her best interests.
"If the parents give instructions for treatment which is not in her best interests, then the doctors now have a clear judgment that they can refuse on conscience grounds - and the judge has explained what conscience means in the circumstances of this case."Reuse content