The mother of a baby with a rare genetic disorder has accepted that her son cannot recover, the High Court in London has been told.
Babies with Luke's condition rarely survive more than a year
But the hearing heard that Ruth Winston-Jones had not reached agreement with doctors and hospital chiefs over his future treatment.
Ms Winston-Jones, 35, from Anglesey, has been fighting to ensure her son Luke continues to receive treatment.
Health officials said he should not be resuscitated if his condition worsened.
The hearing has now been adjourned until Friday morning.
In a separate case earlier this month, a judge ruled doctors should not resuscitate another baby, Charlotte Wyatt, if she stopped breathing.
Charlotte was born prematurely, weighing just one pound with serious heart and lung problems, and her parents had argued doctors should revive her if necessary.
The High Court is set to decide on the best treatment for Luke.
On Thursday, Judge Dame Elizabeth Butler-Sloss, president of the High Court Family Division, heard the two sides had reached agreement on many issues.
The court heard that hours of negotiations behind closed doors have produced agreement between the family and the medical authorities on many aspects of his care.
The court is still hearing details of issues not yet settled.
Dame Elizabeth said: "It is important to point out that there is agreement that this baby cannot recover.
"It is very sad to have to say that he has an incurable genetic disease.
"What we are talking about is what sort of care he should have for the rest of his life, which doctors think is going to be short - how short, nobody knows.
Dame Elizabeth said the aim was "to make the rest of his short life as comfortable as it can be and not cut it short and not unduly prolong it in ways which may be inappropriate for a baby - who is a person and who has rights".
Ruth Winston-Jones, at the High Court, London, before Thursday's hearing
Luke was treated at Ysbyty Gwynedd in Bangor for most of his life before being transferred to Alder Hey hospital two weeks ago for tests.
He has Edwards Syndrome, also known as Trisomy 18.
Babies born with the disease have an average life span of less than two months with fewer than 10% surviving more than a year.
Last week, the Royal Liverpool Children's NHS Trust and the North West Wales NHS Trust made an application in London to be granted a hearing at the High Court.
The hospitals had wanted to be able to let Luke die should his condition get worse, as they say treatment for him may become increasingly aggressive.
Ms Winston-Jones, from Holyhead, who has two other children, said she would fight "all the way" for Luke.
Her counsel, Richard Lissack QC, said: "She wishes to ensure that his life is filled with love and support, that it is as dignified and as comfortable as circumstances will allow and that it ends in a dignified and peaceful way at the proper time and not before."
On Thursday, the High Court issued a statement outlining the details of Luke's case, including some of his medical history.
It said he had suffered a number of cardiorespiratory arrests and had required resusitation.
The most recent cardiac arrest happened on 8 October, four days after he was referred to Alder Hey for further assessment.
The children's court advisory service CAFCASS has been appointed Luke's guardian for the purpose of the proceedings and will represent his interests in the hearing.