LONDON — A five-month legal battle to get permission to take a terminally ill baby to the United States for experimental treatment ended Monday after Charlie Gard's parents told a British court they were withdrawing their legal challenge.

Grant Armstrong, a lawyer representing Chris Gard, 32, and Connie Yates, 31, told Britain's High Court that "time had run out" and the 11-month-old's parents made the decision after the American doctor who offered to treat the baby told them it was too late and wouldn't work.

The couple cried as Armstrong spoke. Yates told the court she "only wanted to give him a chance of life" and hoped that his life had not been in vain.

Yates also had some criticism, saying the family "knew in July (the treatment could work), and our poor boy has been left there to lie in the hospital without treatment while court battles are fought."

Outside the court, Gard said it was time to let Charlie go and "be with the angels." He said his son, who he called an "absolute warrior," won't make it to his birthday in two weeks. "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," he said.

"We could not have more love and pride for our beautiful little boy," he said.

The parents now want "to spend the maximum amount of time they have left with Charlie," Armstrong said. The court previously ruled that Charlie's life-support systems should be switched off and that he should be allowed die with "dignity."

Charlie has a rare, incurable genetic disorder, and his disease has left him with brain damage and unable to move. He can't see or hear and needs a ventilator to breathe. His parents, supported by Michio Hirano, a neurology professor at Columbia University Medical Center, and Italian medical researchers, were seeking the legal right to take him to the U.S. to receive an untested therapy they admitted would not save him.

The London hospital where Charlie has received all his treatment believed there was no medical evidence to support claims the therapy could work. Hospital officials also feared it could prolong his suffering. In Britain, disputes between families and doctors over how to treat a patient are decided by courts. In the U.S., the family makes that decision.

But Armstrong said the parents decided to withdraw from the case after Hirano was no longer willing to administer the therapy after he saw a new MRI scan of the infant's brain. He concluded his brain and muscular damage were too severe.

Charlie's parents had raised almost $2 million to treat his illness, known as encephalomyopathic mitochondrial DNA depletion syndrome.

The case has drawn international interest, including statements from President Trump and Pope Francis in support of the family.

The Vatican said Monday evening that the pope was praying for the family and "feels especially close to them at this time of immense suffering."

In the United States, Republicans in Congress introduced legislation that would give the Gard family U.S. residency and a potential route to treatment, although it wasn't clear whether that would ultimately have enabled them to bypass a British court decision.

"This is a sad day," said Rep. Trent Franks, R-Ariz., who introduced a separate bill to to make Charlie a U.S. citizen.

In Britain, the case has reignited the debate around right-to-life issues, in particular whether requesting treatment that medical evidence shows won't work is a moral right to be asserted by family members or whether hospitals and courts are better placed to make decisions about what is best for a patient.

Outside the court Monday, some advocates and supporters of Charlie's reacted with anger. They chanted "shame on you judge" and "shame on GOSH." GOSH is an acronym for Great Ormond Street Hospital in London, which has been treating Charlie.

Over the weekend, the hospital said its staff had received death threats over the case. "Thousands of abusive messages have been sent to doctors and nurses whose life's work is to care for sick children. Many of these messages are menacing, including death threats," the hospital said in a statement.

"Families have been harassed and discomforted while visiting their children, and we have received complaints of unacceptable behavior even within the hospital itself," the hospital said.

Katie Gollop, a lawyer representing the hospital, said Monday that the hearts of everyone there "go out to Charlie, his mother and father. ... We have more sorrow than I have words to say." Gard and Yates have been discussing with the hospital "the best possible plan for his end of life care," she said.

RELATED STORIES

U.S. residency for terminally ill infant Charlie Gard one step closer

Charlie Gard: What to know about his rare condition