WASHINGTON — Congress has reached a last-minute deal to provide $19.1 billion in emergency aid funding for a series of natural disasters after President Donald Trump dropped his demand that border wall funding be included.

The bill will provide aid to communities across the United States that have been hit by hurricanes, flooding, wildfires, earthquakes, and other natural disasters over the past three years, including Puerto Rico.

The package was held up for months as Trump objected to aid money to help Puerto Rico recover from the devastation of Hurricane Maria in 2017. Trump has repeatedly lied about how much disaster money the island has received. The final bill contains about $1 billion for Puerto Rico: $600 million for food stamps programs, which began running out of money in February, and $304 million in Community Development Block Grant funding to rebuild homes and infrastructure.

The Puerto Rico dispute was resolved in recent weeks, but talks hit a new impasse when Trump demanded the bill contain security funding for agencies policing the US–Mexico border. That package would also have contained aid for humanitarian programs supporting asylum-seekers moving across the border, but Democrats opposed the added border security funding.

As recently as Wednesday evening, it appeared a deal would not be reached before Congress left town and took Memorial Day weekend off. But a deal came together Thursday when Trump agreed to drop his border security demands. The bill passed the Senate Thursday afternoon by a vote of 85–8 and is expected to pass the House Thursday or Friday, allowing Trump to sign it into law by the end of the week.

The deal represents yet another funding victory for Democrats, who have consistently managed to prevent Trump’s border priorities from getting into spending bills.

Trump insisted at a White House press conference Thursday afternoon that he would get the funding eventually. "We're going to get the immigration money later, according to everybody," he said.

This is a developing story. Check back for updates and follow BuzzFeed News on Twitter.‏