Charlie Gard's parents have ended their legal fight over treatment for the terminally-ill baby.
Chris Gard and Connie Yates announced their decision as a High Court judge was preparing to oversee the latest round of a five-month legal battle.
Mr Justice Francis had been scheduled to analyse what the couple said was fresh evidence at a hearing in the Family Division of the High Court in London.
A lawyer representing Charlie's parents told Mr Justice Francis that "time had run out".
"This case is now about time," said their barrister Grant Armstrong, adding: "Sadly time has run out."
Mr Armstrong said Charlie's parents had made a decision following the latest medical reports and scans.
Praying for #CharlieGard & his parents who no doubt love their baby boy immensely.
However it is his best interest that matters the most.— H; (@helen_a15) July 24, 2017
Mr Armstrong said damage to Charlie's muscle and tissue was irreversible.
"The parents' worst fears have been confirmed," he said.
"It is now too late to treat Charlie."
The couple felt that continuing their fight would cause Charlie pain, said Mr Armstrong.
He said the case was "worthy of a Greek tragedy".
Mr Armstrong said Charlie's parents hoped to set up a foundation.
He said they wanted lessons to be learned.
"Dark days lie ahead for these parents," said Mr Armstrong.
"The parents wish to treasure their remaining time with Charlie, however short that may be."
Mr Justice Francis paid tribute to Charlie's parents and said no-one could comprehend their agony.
Charlie Gard's mother Connie Yates has told the High Court: "We only wanted to give him a chance of life."
Great Ormond Street Hospital said "the agony, desolation and bravery" of the Gard's decision "command GOSH's utmost respect and humble all who work there".
Mr Justice Francis paid tribute to the family and said no-one could comprehend their agony.
He also praised Great Ormond Street staff who had worked "tirelessly".
The judge said it was a "disgrace" that staff had been subjected to abuse and threats.
But outside court, supporters calling themselves Charlie's Army reacted with anger and tears, chanting "shame on you judge" and "shame on GOSH ".