The Senate on Thursday afternoon approved a $19 billion disaster-relief bill to help several states and Puerto Rico recover from hurricanes, floods and wildfires -- after President Trump backed off from his demand that border security money be added to the package.

Lawmakers overwhelmingly passed the measure with an 85-8 vote; eight Republicans opposed it. Congress is expected to pass the bill before leaving for its weeklong recess ahead of Memorial Day.

"We expect the bill will pass the House, and the president, despite his protestations, will sign the bill," Senate Minority Leader Chuck Schumer, D-N.Y., said.

He added that President Trump's intervention in negotiations was partly to blame for the bill's delay.

HOUSE PASSES $19B DISASTER AID BILL OVER TRUMP OPPOSITION

“Each time the president messes in, things get messed up,” he said.

Trump said he would sign the measure while promising that the money he wants for border security will pass soon. He tweeted Thursday night: "The U.S. Senate has just approved a 19 Billion Dollar Disaster Relief Bill, with my total approval. Great!"

Senate Appropriations Committee Chairman Richard Shelby, R-Ala., said he spoke with Trump about the lack of emergency funds to address the migrant surge at the U.S.-Mexico border.

“I had a nice conversation with the president,” Shelby said. “The president said OK.”

The legislation is crucial to states still reeling from devastating hurricanes over the past two years and epic flooding that drenched Iowa, Nebraska and Missouri. It would provide over $600 million in nutrition assistance and $304 million in aid for Puerto Rico, which was devastated by Hurricane Maria in 2017.

Disaster aid packages are almost always bipartisan, but the bill was held up for months over failed negotiations over border security and funding for Puerto Rico, which Trump opposed.

"We got all we wanted for Puerto Rico," Schumer said.

CLICK HERE TO GET THE FOX NEWS APP

Trump had requested $4.5 billion to address the influx of migrants from Central America coming into the United States. Shelby said lawmakers would push for a separate deal to fund border aid.

The bill also would provide disaster relief for farmers and various infrastructure projects to reduce the risks of floods and hurricanes and development grants for rural communities.

Fox News' Doug McKelway and Chad Pergram contributed to this report.