The parents of terminally ill British baby Charlie Gard have ended their legal challenge to take him to the US for experimental treatment.
A lawyer representing Chris Gard and Connie Yates told the High Court "time had run out" for the baby.
Mr Gard said it meant his "sweet, gorgeous, innocent little boy" would not reach his first birthday on 4 August.
"To let our beautiful little Charlie go" was "the hardest thing we'll ever have to do", his mother said.
Charlie's parents said they made the decision because a US doctor said it was now too late to give Charlie nucleoside therapy.
"We only wanted to give him a chance of life," Ms Yates told the court in a statement.
"A whole lot of time has been wasted," she added.
"We are sorry we could not save you."
Their lawyer, Grant Armstrong, said the parents' worst fears had been confirmed.
He told the judge, Justice Francis, that US neurologist Michio Hirano had said he was no longer willing to offer the baby experimental therapy after he saw the results of a new MRI scan last week.
He added Mr Gard and Ms Yates, from west London, now hoped to establish a foundation to ensure Charlie's voice "continues to be heard".
In a statement outside court, Mr Gard said Charlie was an "absolute warrior" and they "could not be prouder of him."
"Charlie has had a greater impact on and touched more people in this world in his 11 months than many people do in a lifetime.
"We could not have more love and pride for our beautiful boy.
"We are now going to spend our last precious moments with our son Charlie, who unfortunately won't make his first birthday in just under two weeks' time."
They had raised £1.3 million in donations to take their son abroad for treatment.
Charlie has encephalomyopathic mitochondrial DNA depletion syndrome. He has brain damage and cannot move his arms or legs.
Katie Gollop, the lawyer representing Great Ormond Street Hospital (GOSH), where Charlie has been treated since October, said the hearts of each person at the hospital "go out to Charlie, his mother and father".
The hospital paid tribute to the "bravery" of the decision made by Charlie's parents.
In a statement, it said: "Over the weekend, they communicated their desire to spend all the time they can with Charlie whilst working with the hospital to formulate the best possible plan for his end of life care.
"The agony, desolation and bravery of their decision command GOSH's utmost respect and humble all who work there."
Justice Francis paid tribute to Charlie's parents and said no-one could comprehend their agony and no parents could have done more.
He said they were now prepared to accept Charlie should be moved to palliative care and be allowed to die with dignity.
Outside court, 'Charlie's Army' campaigners reacted angrily and chanted, "shame on you judge" and "shame on GOSH".
Falling to the ground, one female supporter said: "He had a chance and you took it away."