President Trump signed a sweeping opioids bill into law Wednesday, a rare piece of legislation that garnered bipartisan support.

The bill addresses numerous aspects of the opioid crisis, including prevention, treatment and recovery. It knits together bills sponsored by hundreds of lawmakers, many of whom are embroiled in tough reelection battles and can now tout their support of the law in the run-up to Election Day.

“Together we will defeat this epidemic — it’s a true epidemic — as one people, one family and one magnificent nation under God,” Trump said.

Drug overdoses killed about 72,000 people last year, and opioids have become a major campaign issue for both Democrats and Republicans. Drugs have become central in races in states such as West Virginia, Ohio and Florida, which have been hit hard by the opioid crisis. According to an analysis by the Wall Street Journal, ads in congressional and gubernatorial races that mention opioids have aired more than 500,000 times in 25 states; in 2014, there was only one ad about opioids, in a Senate race in Kentucky.

Just a handful of congressional Republicans dissented from the wildly popular opioids bill — it passed 393 to 8 in the House and 98 to 1 in the Senate — although Trump falsely said at a campaign rally in Ohio this month that the legislation cleared Congress with “very little Democrat support.”

Democratic Senate candidates, particularly those from states most ravaged by the opioid crisis, have promoted their efforts to stem the epidemic in an array of positive campaign ads.

One ad from Sen. Sherrod Brown (D-Ohio) features a nurse speaking about the high rate of infants born with a dependency on opioids and says: “They need a champion more than anyone. That’s Sherrod Brown.” Sen. Tammy Baldwin (D-Wis.) earlier this year released an ad with a similar message, featuring a Wisconsin mother whose daughter died three years ago from an overdose.

In West Virginia, the state with the highest rate of drug overdoses, Sen. Joe Manchin III (D) has hammered his opponent, Republican Patrick Morrisey, over his history of lobbying for the pharmaceutical industry, although Morrisey has said that he did not lobby on behalf of bills involving opioids.

“When I found out my attorney general was a lobbyist that helped the state to be inundated with pills, I was just floored,” a West Virginia nurse says in an ad the Manchin campaign released earlier this year.

But even on an issue that has prompted an overwhelming desire for action, political considerations soon took over. Some believe that lawmakers enthusiastically endorsed the bill so they could tout a win before Election Day. Some controversial aspects that passed out of the House — such as giving the attorney general power to create a special category for synthetic drugs and penalties for those who make or sell them — were stripped out of the final legislation to ensure passage.

The law contains a measure sponsored by Sens. Rob Portman (R-Ohio) and Amy Klobuchar (D-Minn.) that will close a loophole that makes it easier for traffickers to send fentanyl, a synthetic opioid that is responsible for the sharp increase in overdose deaths, through the mail, primarily from China.

It will also have a large focus on treatment, creating a grant program for recovery centers that include housing and job training. It also increases access to medication-assisted treatment, in which a drug user takes an opioid medication under medical supervision and is ultimately weaned off drugs. It allows broader coverage for substance abuse treatment under Medicaid and Medicare.

Public health officials say the new law is an important first step toward fighting the opioid crisis, but they say it mostly tinkers with the problem rather than addressing it directly.

“It’s a very good starting point. But I call it wave one, and I hope there will be wave two,” said Daniel Ciccarone, a professor of family and community medicine at the University of California at San Francisco. “This is everything but the kitchen sink. Anyone who has any thought about how to address the opioid crisis got a bill in there.”

Congress has appropriated $8.5 billion for opioid-related programs this year, but there is no guarantee of additional funding in later years. Sen. Elizabeth Warren (D-Mass.) and Rep. Elijah E. Cummings (D-Md.) have proposed committing $100 billion over 10 years to fighting the opioid crisis.

“I certainly think it’s moving in the right direction, but I do think it’s woefully underfunded,” said Chinazo Cunningham, a professor of medicine at the Albert Einstein College of Medicine and Montefiore Medical Center. “It feels to me as though it’s not really a coordinated effort, that it’s bits and pieces — honestly, a little bit working on the edges.”

In September, the Trump administration announced that it awarded more than $1 billion in grants to help fight opioids, focusing primarily on treatment and prevention.

The bill signing comes almost a year after Trump declared a public health emergency on opioids. A report released by the Government Accountability Office this week found that the declaration has led to only incremental steps, such as surveying doctors on how they prescribe a medication used to treat opioid addiction.

Colby Itkowitz contributed to this report.