(Reuters) - The U.S. Senate voted overwhelmingly on Wednesday to support sweeping legislation that will reshape the way the Food and Drug Administration approves new medicines.

A participant prepares to receive an antibody infusion of a drug that is part of a clinical trial for a functional HIV cure at the National Institutes of Health in Bethesda, Maryland, U.S. November 22, 2016 in this still image from video. REUTERS/Gershon Peaks/RVN

It will also provide funding for cancer and Alzheimer’s research, help fight the opioid epidemic, expand access to mental health treatment and advance research into precision medicine.

Two years in the making, the 21st Century Cures Act was passed last week by the House of Representatives and will now go to President Barack Obama to sign into law. Supporters say it will speed access to new drugs and devices, in part by allowing clinical trials to be designed with fewer patients and cheaper, easier-to-achieve goals.

“For the second consecutive year, the Senate is sending the President another Christmas miracle for his signature,” Senator Lamar Alexander, a Republican from Tennessee said in a statement. “Last year, it was the Every Student Succeeds Act, and this time, it’s the 21st Century Cures Act — a bill that will help virtually every American family.”

Critics of the legislation say it gives massive handouts to the pharmaceutical industry and will lower standards for drug and medical device approvals.

“This gift – which 1,300 lobbyists, mostly from pharmaceutical companies, helped sell – comes at the expense of patient safety by undermining requirements for ensuring safe and effective medications and medical devices,” consumer watchdog Public Citizen said in a statement.

Democratic Senator Elizabeth Warren was among the handful of senators who voted against the bill, as was independent senator and former Democratic presidential candidate Bernie Sanders. Each decried what they described as big handouts to the pharma industry. Even so the bill passed 94-5. The House passed it by a vote of 392-26.

The $6.3 billion act, sponsored by Republican Representative Fred Upton, authorizes $4.8 billion for the National Institutes of Health and $500 million to the Food and Drug Administration.

It also calls for $1 billion over two years to battle the opioid epidemic. On Tuesday the Drug Enforcement Administration issued a report showing that in 2014 about 129 people died every day as a result of drug poisoning. Of those, 61 percent are opioid or heroin related.

“Opioids such as heroin and fentanyl - and diverted prescription pain pills - are killing people in this country at a horrifying rate,” Acting Administrator Chuck Rosenberg said. “We face a public health crisis of historic proportions.”

The bill also calls for $1.8 billion in funding for Vice President Joseph Biden’s Cancer Moonshot initiative designed to bolster cancer research by reducing bureaucracy and promoting research collaboration.

Critics note that the money described in the bill must be appropriated by separate funding bills and that the money may ultimately never materialize. Yet the changes to the clinical trial process, something long sought by the drug industry, will be set in stone regardless of whether money for the research projects is forthcoming.

Among those changes: Greater prominence will be given to “real world” evidence gathered outside the framework of a randomized, controlled clinical trial, the gold standard for determining whether a drug is safe and effective. Such evidence could be much easier for drug companies to collect.

“The passing of 21st Century Cures Act is a show of extraordinary bipartisan unity after a divisive election that should be celebrated,” said Ellen Sigal, chair of the patient advocacy group Friends of Cancer Research.

Under the Act patient input will be formally incorporated into the FDA’s drug review process.

Funding for the Act will be offset by reductions in some Medicaid payments and through the sale of oil from the Strategic Petroleum Reserve. The White House supports the bill but said earlier it was concerned that draining the Petroleum Reserve “continues a bad precedent of selling off longer term energy security assets to satisfy near term budget scoring needs.”