The US Senate has overwhelmingly approved a $19.1bn (£15.06bn) disaster aid package, advancing legislation that would break a months-long impasse over federal funding for stretches of the country afflicted by natural disasters.

President Donald Trump wrote on Thursday evening the Senate had his “total support” in passing the deal.

House lawmakers left town before the agreement was announced, leaving prospects for rapid passage there uncertain – though the chamber’s Democratic leaders hope to use a procedural move to quickly advance the measure on Friday.

The deal, which congressional leaders presented hours before the Senate vote, would send aid to victims of Western wildfires, Midwestern flooding and hurricanes that hit the Southeast and Puerto Rico, as well as to other disaster-affected areas across the country.

The package does not include the US-Mexico border funding the Trump administration requested.

Wildfires spread across California – in pictures Show all 32 1 /32 Wildfires spread across California – in pictures Wildfires spread across California – in pictures Firefighters battle a blaze at the Salvation Army Camp in Malibu Getty Wildfires spread across California – in pictures Flames from the Camp fire burn near a home atop a ridge near Big Bend AFP/Getty Wildfires spread across California – in pictures Cathy Fallon (centre) who stayed behind to tend to her horses during the Camp Fire, embraces Shawna De Long (left) and April Smith who brought supplies for the horses Reuters Wildfires spread across California – in pictures A helicopter drops flame retardant on a wildfire in Malibu Getty Wildfires spread across California – in pictures An air tanker drops water on the fire along the Ronald Reagan Freeway in Simi Valley AP Wildfires spread across California – in pictures An abandoned car from fleeing residents of Paradise in the Pentz road area EPA Wildfires spread across California – in pictures A firefighter tackles the fire along the Ronald Reagan Freeway in Simi Valley AP Wildfires spread across California – in pictures A Jack In The Box fast food restaurant burns as the Camp fire moves through Paradise, California AFP/Getty Wildfires spread across California – in pictures Yuba and Butte County Sheriff officers label a body bag AFP/Getty Wildfires spread across California – in pictures Firefighters hose down trees on Bell Canyon Road, near Malibu AFP/Getty Wildfires spread across California – in pictures A fire burns at the Salvation Army Camp Getty Wildfires spread across California – in pictures A firefighting DC-10 makes a fire retardant drop over a wildfire in the mountains near Malibu Canyon Road AP Wildfires spread across California – in pictures A house burns in Paradise, California AFP/Getty Wildfires spread across California – in pictures Bins have melted and ballooned in the heat in Magalia, Butte County EPA Wildfires spread across California – in pictures Satellite image taken on 8 November shows plumes of smoke from the Camp Fire stretching across portions of Northern California AFP/Getty Wildfires spread across California – in pictures Firefighters battle the Camp Fire AP Wildfires spread across California – in pictures Firefighters battle the Woolsey Fire Reuters Wildfires spread across California – in pictures Deputy Coroner Justin Sponhaltz, of the Mariposa County Sheriff's Office, recovers human remains found at a home destroyed by the Camp Fire AP Wildfires spread across California – in pictures Buildings burn in Paradise, California EPA Wildfires spread across California – in pictures Local residents bring their horses to Zuma Beach and away from the Woolsey Fire in Malibu Reuters Wildfires spread across California – in pictures A used car dealership burns in Paradise, California Reuters Wildfires spread across California – in pictures Yuba and Butte County Sheriff officers inspect a burned vehicle after discovering remains nearby in Concow AFP/Getty Wildfires spread across California – in pictures Firefighters battle the flames in Thousand Oaks Reuters Wildfires spread across California – in pictures A house burns in Paradise, California AFP/Getty Wildfires spread across California – in pictures A house burns in Paradise, California AP Wildfires spread across California – in pictures Search and rescue teams work to evacuate patients from the burning Feather River Hospital in Paradise, California AFP/Getty Wildfires spread across California – in pictures Embers blow in the wind in Paradise, California AFP/Getty Wildfires spread across California – in pictures In Butte County, the sky is filled with the smoke of the Camp Fire EPA Wildfires spread across California – in pictures Firefighters at work in Thousand Oaks Reuters Wildfires spread across California – in pictures A house burns in Paradise, California AP Wildfires spread across California – in pictures The burned remains of a house and car are left after the Camp Fire in Paradise, California AFP/Getty Wildfires spread across California – in pictures A shop burns in Paradise, California AFP/Getty

That demand had proved contentious, and leaving it out sidestepped a fight over immigration that had further complicated the delicate disaster-aid negotiations.

The Senate passed the measure 85 to 8, with bi-partisan backing that followed months of finger-pointing as Democrats, Republicans and President Trump fought over funding for Puerto Rico and other issues.

Several hurdles remain for the bill to be signed into law.

Senators said Thursday afternoon that they felt confident Mr Trump would sign the deal, and Mr Trump saying he backed the deal could ease fears of a last-minute rejection.

Before going to President Trump, the disaster package would need approval from the House, but lawmakers there left for the Memorial Day recess before the Senate voted on Thursday.

The House is scheduled to meet on Friday for a brief “pro forma” session with few lawmakers present.

House leaders hope to advance the measure then by unanimous consent, according to a senior House Democratic aide, but a single objection from a lawmaker could sink the package until the House returns.

Before the agreement was announced, a Republican aide said conservatives opposed to new government spending could object.

Despite the remaining hurdles, prospects for passing legislation before the recess appeared much brighter than they did early on Thursday, when disputes over how the border money would be spent had appeared to put a deal out of reach.

Senator David Perdue said he and senator Rick Scott, whose state is awaiting federal money to rebuild from Hurricane Michael, called Mr Trump and won approval for a disaster-aid plan that left out additional immigration-related funding for the Departments of Homeland Security and Health and Human Services.

“We didn’t think we could wait any longer to get this done,” Mr Perdue said.

Hurricane Michael: Storm surge captured in ruined back garden in CCTV video

“Sometimes when you put too much together, you can’t get anything done. So what he did today was break through a logjam and say: ‘look, let’s divide this and start working on border security individually or independently, and let’s get this done today’.”

Senate appropriations committee chairman Richard Shelby said Congress would return to border funding in a separate measure after the recess.

Senate minority leader Charles Schumer said the disaster deal was reached despite Mr Trump, not because of him – noting that on Thursday the president twice blocked previous congressional accords on the legislation.

“Republicans are learning that they’re going to have to break from the president to get anything done,” Mr Schumer said, “because the president...has been an obstructionist force – insisting on his own way when he knows that his own way can’t pass.”

The disaster aid bill has been pending since last year, and the slow pace of talks has frustrated legislators of both parties, especially as past disaster bills have often been bipartisan and rarely featured the delays or rancour that has accompanied this one.

For much of that time, the main sticking point has been a struggle between Democrats – who pushed for more aid to Puerto Rico – and Mr Trump, who has spent months complaining about fiscal mismanagement by the territory’s government and has drastically overstated the sums sent to the island in the wake of Hurricane Maria.

Puerto Rico, which is still trying to recover from the 2017 hurricane, will receive more than $1bn (£788 million) under the package, according to a House Democratic aide.

That includes $600 million (£473 million) in emergency funding for Puerto Rico’s food stamp programme, as well as more than $300 million (£236 million) to help the island cover costs for infrastructure repair projects.

Puerto Rico Governor Ricardo Rosselló urged passage of the legislation in a statement on Thursday.

He also referred to his government’s disputes with Mr Trump about recovery funding in the wake of Hurricane Maria, which devastated communities there and is estimated to have led to the deaths of thousands of people in 2017.

“Even though Puerto Rico was repeatedly told that we would not receive one more dollar in disaster relief, this legislation shows that many in Washington DC understand that our recovery is not complete,” Rosselló said.

The White House on Thursday announced a separate program to distribute $16bn (£12.6bn) to farmers hurt by Trump’s trade war with China.

Trump throws paper towels out to Puerto Rico hurricane victims

China has placed tariffs on incoming US crops such as corn and soybeans, cutting foreign demand and, consequently, domestic prices for US farmers.

Beijing levied the import taxes in retaliation against the Trump administration’s tariffs on hundreds of billions of dollars of Chinese goods coming into the United States.

The legislation the Senate approved on Thursday also includes billions for farmers in the Southeast and other regions hit by 2018 and 2019 natural disasters, as well as close to $1bn (£788,000) for repairs to military installations that suffered damage from Hurricanes Florence and Maria and other natural disasters, according to a summary provided by Shelby’s office.

Top Democratic negotiators, such as House Appropriations Committee Chairwoman Nita Lowey of New York, cheered news of the disaster-aid agreement.

“Chairman Lowey is pleased that President Trump and Republicans have agreed to bipartisan, comprehensive disaster relief legislation that will meet urgent needs across the country,” Ms Lowey’s spokesman Evan Hollander, said on Thursday.

“If the Senate passes the legislation today, House Democrats support clearing it through the House as soon as possible.”

The congressional deadlock has stalled support for victims of wildfires in California and other Western states, southeastern residents hurt by hurricanes, Midwestern states that faced historic flooding earlier this year, and other areas.

In Puerto Rico, food stamp payments were cut for more than one million residents after the program’s emergency funding expired in March.

In recent talks, negotiators had closed the gap on Puerto Rico funding, only to see a new dispute spring up over the Trump administration’s demand for $4.5bn (£3.5bn) in new border funding.

While lawmakers from both parties broadly agree border agencies need more funding to address the influx of individuals and families arriving from Central America, Democrats and the White House are split over how the funding should be used.

Democrats demanded restrictions to prevent it from going to certain detention and enforcement programmes they oppose, while the Trump administration sought more leeway.

President Trump says federal gov’t is 'ready' for Hurricane Florence, and reflects on what he describes as 'incredibly successful' response to Puerto Rico hurricane

Before the agreement was announced on Thursday, House Speaker Nancy Pelosi had urged the Senate to pass her chamber’s version of the disaster bill, a package that won the support of all of the chamber’s Democrats and 34 Republicans.

She also provided a preview of a fight over border spending that will be waiting for lawmakers when they return in June.

Addressing reporters at a news conference, the House leader declared the Trump administration’s conditions for border funding “unacceptable”.