WASHINGTON — The Senate on Thursday passed a bipartisan deal that would provide more than $19 billion in disaster aid funding to parts of the United States hit by hurricanes, flooding, earthquakes and wildfires, following months of negotiation.

Senators backed the measure, 85-8, just a few hours after the agreement was reached. The House will have to vote on the bill before it’s sent to Trump’s desk. House lawmakers have already left for their recess, but the chamber could still pass it quickly through unanimous consent.

"I totally support it," Trump said of the legislation at a White House event on Thursday.

Leaving a closed-door Senate Republican lunch earlier in the day, Senate Appropriations Committee Chairman Richard Shelby, R-Ala., told reporters that an agreement had been reached.

He said that he had spoken to President Donald Trump on Thursday afternoon about the parameters of the deal, which excluded the $4.5 billion in border funding that the White House and the Republicans kept demanding.

The Senate voted on the measure Thursday afternoon before leaving Washington for a weeklong Memorial Day recess. This comes after Senate Majority Leader Mitch McConnell, R-Ky., warned earlier in the day that the upper chamber would remain in session this week until they passed a disaster aid bill.

According to a breakdown of the bill from Shelby’s office, it provided about $900 million to Puerto Rico, which was ravaged by Hurricane Maria in 2017. That money would go toward nutrition assistance and a community development block grant, both of which were key Democratic priorities.

The bill also included a provision that would require the Trump administration to make almost $9 billion in previously withheld aid available to Puerto Rico, according to a summary of the bill provided by Sen. Patrick Leahy, D-Vt., ranking member on the Senate Appropriations Committee.

Funding for Puerto Rico had long been a sticking point in negotiations because Trump was opposed to giving the territory more aid. In April, he falsely claimed on Twitter that “Puerto Rico got 91 billion dollars for the hurricane" when the federal government had only allocated $40 billion for the island's recovery and most of it hasn't reached it yet.