Charlie Gard’s parents have decided to end their legal fight over the treatment of their terminally ill child. The months-long, emotionally charged case sparked a bioethical debate about end-of-life issues and captured the attention of world leaders, including Pope Francis and President Donald Trump.

Attorney Grant Armstrong said the boy’s parents, Chris Gard and Connie Yates, are withdrawing their appeal of court orders that say Charlie’s treatment should end, according to The Associated Press.

Yates and Gard cried in court as their attorney said time had run out for their 11-month-old, after a U.S. doctor said it was too late to give the baby an experimental treatment on which the couple had pinned their hopes.

Outside the hospital where Charlie is being treated, his father gave an emotional statement, saying the family might never know what would have happened had Charlie been allowed to receive the experimental therapy earlier in his short life.

“Had Charlie been given the treatment sooner, he would have had the potential to be a normal, healthy little boy,” Chris Gard said, fighting back tears.

With Charlie’s mother standing by his side, Gard decried the “time wasted” by court battles and said that as a result of the delays and legal barriers, his son would not live to see his first birthday, on Aug 4.

“We will have to live with the what-ifs that will haunt us for the rest of our lives,” the father said.

Charlie has mitochondrial DNA depletion syndrome, a rare genetic condition that has robbed him of the ability to see, hear, move or breathe on his own.

He is at London’s Great Ormond Street Hospital, alive only because a machine is helping him breathe. His doctors have concluded that nothing more can be done for him and that he should be taken off life support.

But his parents had been engaged in a court battle to have him undergo the experimental treatment in the United States, in the hope that it could help. They’d raised nearly $1.7 million to transport the boy to the United States if the court approved.

Other courts had sided with Charlie’s doctors, who said the experimental treatment was a fruitless endeavor that has not been tested on someone with Charlie’s specific condition.

Meanwhile, the hospital argued, Charlie has been in pain.

“If Charlie has had a relationship with the world around him since his best interests were determined, it has been one of suffering,” the hospital said in a statement read by attorney Katie Gollop.

But Charlie’s parents had garnered support from Trump, Francis and U.S. lawmakers.

“If we can help little #CharlieGard, as per our friends in the U.K. and the Pope, we would be delighted to do so,” Trump tweeted on July 3.

“To defend human life, above all when it is wounded by illness, is a duty of love that God entrusts to all,” Pope Francis offered over Twitter.

Protesters who wanted Charlie to receive the experimental treatment rallied outside the courthouse, including some who came from as far as the United States. Others have sent death threats to the hospital treating him.

“In recent weeks the community has been subjected to a shocking and disgraceful tide of hostility and disturbance,” the Great Ormond Street Hospital said in a statement.

“Staff have received abuse both in the street and online. Thousands of abusive messages have been sent to doctors and nurses whose life’s work is to care for sick children.”

After Charlie’s parents made their announcement Monday, the hospital released a statement defending its decisions, while also commending the parents.

“The agony, desolation and bravery of their decision command GOSH’s utmost respect and humble all who work there,” the statement said. “Whilst GOSH has striven to work with them throughout, Charlie’s needs have taken priority.”

Yates said she hoped her son’s life wouldn’t be in vain.

“We only wanted to give him a chance of life,” she said.

Gard and Yates said they plan to spend Charlie’s final moments by his side in the hospital.

“We will let our son go and be with the angels,” Gard said.