President Donald Trump signed the controversial "right-to-try" bill into law on Wednesday, which bypasses drug regulators to give gravely ill patients access to experimental medicines.

The legislation allows patients with life-threatening conditions to ask drugmakers for medicines that have cleared some testing but still haven't been approved by the Food and Drug Administration. Previously, patients would need to ask the FDA for access to experimental treatments.

Trump and Vice President Mike Pence had been major supporters of passing the measure, which proponents say gives patients hope they would not otherwise have. Last week the House of Representatives approved the bill, the same version the Senate passed in August.

It allows certain patients to ask drugmakers for medicines that have passed Phase 1 of the FDA approval process but haven't been approved yet and are still undergoing testing. Patients must have exhausted other options and be unable to participate in a clinical trial. Drugmakers aren't obligated to give patients the requested experimental medicines.

Critics say the legislation undermines the FDA's authority to regulate drugs and could leave patients vulnerable to medicines that might not work or may even be harmful. The agency already runs an "expanded access" program where seriously ill patients can apply to gain access to experimental treatments.

Commissioner Scott Gottlieb has said the agency grants 99 percent of these requests. In a statement Wednesday, Gottlieb said the FDA is ready to implement the "right-to-try" legislation.

"The FDA is dedicated to achieving the goals that Congress set forth in this legislation, so that patients facing terminal conditions have an additional avenue to access promising investigational medicines," he said.

While signing the bill Wednesday, Trump said he never understood why passing this bill was hard since it can take years for drugs to undergo clinical trials.

"Right to try. That's such a great name," Trump said. "Some bills, they don't have a good name. Really. But this is such a great name, from the first day I heard it. Right to try. And a lot of the trying is going to be successful. I really believe that. I really believe it."