A judge has ruled that doctors treating toddler Charlotte Wyatt can decide not to resuscitate her if they feel it would not be in her best interests.
Charlotte's first visit home without medical staff was on Christmas Day
The order came after an emergency hearing on Thursday, as Charlotte's condition deteriorated.
She has been suffering from an aggressive virus and doctors say the next few hours are "crucial".
The ruling follows a series of legal battles over the severely disabled toddler's care.
The little girl has so far spent the majority of her life at St Mary's Hospital in Portsmouth after being born prematurely with severe brain and lung damage.
Her parents have fought a series of court battles with Portsmouth NHS Trust over whether Charlotte, now aged two, should be given artificial ventilation if her condition worsened.
In October last year, her parents Darren and Debbie, won a partial victory when a judge lifted an order saying doctors would not be acting unlawfully if they decided not to give Charlotte artificial ventilation in a life-threatening situation.
The judge said then that her parents should reach agreement with the doctors about their daughter's treatment if a crisis arose.
'Free not to treat'
But in his latest ruling, Mr Justice Hedley said Charlotte's deterioration meant that circumstances had changed.
Doctors had told the court she had developed a cough, probably caused by a viral infection, a week ago, and was now having difficulties breathing.
Dr K, one of the team treating her - none of whom can be named - told the court that resuscitation would be futile and would "inflict unnecessary pain on this child, who has already suffered as much as she has".
Mrs Wyatt, currently separated from her husband, does still feel Charlotte would recover if she was ventilated.
But Justice Hedley ruled it was in the best interests of the toddler that "the medical profession should be free to refrain from intervention by way of intubation and resuscitation.
"A decision to desist would be lawful."
He also paid tribute to the commitment shown by the Wyatts, their legal team and the doctors treating Charlotte.
The judge added: "There is something to be said for a society in which the fate of a severely disabled child, wholly unable to articulate her own position, receives the care and attention from the state, and from authorities authorised by the state, that has been given in this case."
In a statement, Portsmouth Hospitals NHS Trust said "The situation with Charlotte Wyatt is extremely serious, although at present she is currently in a stable condition.
"Therefore an order is back in place."
It added: "It is important to note that all the clinicians involved in yesterday's court hearing, including the Wyatt family's own medical advisor, supported the actions of the trust's clinician caring for Charlotte Wyatt."