© The Associated Press President Donald Trump hugs Duchenne Muscular Dystrophy patient Jordan McLinn after signing the "Right to Try" act in the South Court Auditorium on the White House campus, Wednesday, May 30, 2018, in Washington. (AP Photo/Evan Vucci)

WASHINGTON — President Donald Trump signed legislation Wednesday aimed at helping people with deadly diseases try experimental treatments, calling it a "fundamental freedom" that will offer hope and save lives.

Joined by families dealing with amyotrophic lateral sclerosis, also called Lou Gehrig's disease, and other diseases, Trump signed the so-called Right to Try bill and said he never understood why the issue had lagged for years and Congress hadn't acted sooner.

"There were no options. But now you have hope — you really have hope," Trump said. He noted that "for many years, patients, advocates and lawmakers have fought for this fundamental freedom."

The bill cleared the House last week following an emotional debate in which Republicans said it would help thousands of people in search of hope. Many Democrats said the measure was dangerous and would give patients false hope.

As he distributed pens after signing the bill at a small table, 8-year-old Jordan McLinn of Indianapolis, who suffers from muscular dystrophy, waited to embrace the president, drawing laughter in the auditorium when he put his elbow on the table and held up his chin. Trump hugged McLinn and kissed him on the forehead. "He's going to be fantastic," the president told McLinn's mother.

The president was joined by Health and Human Services Secretary Alex Azar, Food and Drug Administration Commissioner Scott Gottlieb and some of the bill's allies in Congress, including Sens. Ron Johnson, R-Wis., and Joe Donnelly, D-Ind.

Trump had supported efforts to gain access to the treatments during his 2016 campaign. In his State of the Union address, the president said people who are terminally shouldn't have to travel "from country to country to seek a cure."

The measure would give people diagnosed with life-threatening conditions who have exhausted treatment options the ability to gain access to unproven drugs without first getting permission from the FDA.