President Trump signed the "Right to Try Act" into law Wednesday, allowing terminally ill patients to seek experimental drugs not yet approved by the Food and Drug Administration (FDA).

"They've been trying to have it passed for years, I never understood why," Mr. Trump said at the signing ceremony, surrounded by affected patients and their families. "I never understood why they didn't do this."

Mr. Trump called on Congress to address the matter earlier this year in his State of the Union address. He specifically thanked Sens. Ron Johnson, R-Wisc., and Joe Donnelly, D-Ind., for their help in pushing the legislation through Congress.

Get Breaking News Delivered to Your Inbox

"There are no options, but now you have hope. You really have hope," the president said.

He also called out Obamacare, saying that his administration has mostly dismantled the former president's signature piece of legislation and teasing two "great, inexpensive, but really good health care" plans coming up in the next few weeks.

While the law may provide some patients with opportunities to seek additional untried treatments, some patient groups and medical advocates oppose the law out of concern that desperate patients may be targeted. Pharmaceutical companies do not have to provide the medications, and the costs may be prohibitive for many families. Others fear the new law could actually make it more difficult to get new drugs approved by the FDA.

The president praised the "extraordinary courage" of the patients before signing the bill into law, taking a moment to hug Jordan McLinn, a young boy diagnosed with muscular dystrophy. McLinn's family had helped push for a similar "right to try" law in Indiana, which then-Governor Mike Pence signed in 2015.

"They will be with their families for a long time, or maybe just a longer time," Mr. Trump said.