Congress has reached a deal on a "clean" disaster aid bill, after President Trump told lawmakers he would sign legislation even if money tied to the U.S.-Mexico border was dropped from the package.

Senate Appropriations Committee Chairman Richard Shelby (R-Ala.) said on Thursday afternoon that they had reached an agreement on the long-stalled legislation to respond to a recent spate of wildfires, hurricanes and storms.

"We've proposed ... that we come forth with a clean disaster package, a lot of things off including border security stuff, just disaster, basically. And the president said OK," Shelby told reporters after a closed-door GOP lunch.

GOP Sens. James Lankford (Okla.), Roger Wicker (Miss.) and Rick Scott (Fla.) also confirmed that it was their understanding Trump would sign a bill that included only disaster money.

The Senate is expected to vote on the agreement Thursday before leaving town for the weeklong Memorial Day recess. Shelby noted that he had spoken with House Appropriations Committee Chairwoman Nita Lowey (D-N.Y.), who was supportive of the deal, but stopped short of saying if the House would be able to pass it Thursday.

Evan Hollander, Lowey's spokesman on the Appropriations Committee, said Lowey is supporting the agreement and wants to pass it through the House "as soon as possible."

"Chairwoman Lowey is pleased that President Trump and Republicans have agreed to bipartisan, comprehensive disaster relief legislation that will meet urgent needs across the country. If the Senate passes the legislation today, House Democrats support clearing it through the House as soon as possible," he said.

If the Senate was able to pass a disaster-only bill, the House - which is poised to leave town Thursday - could pass the legislation by a voice vote.

A Democratic leadership aide said the caucus supports the legislation and is hoping to pass it by consent on Friday.

The deal, according to a GOP appropriations aide, will include $19.1 billion for disaster recovery, including $600 million in food stamp money for Puerto Rico and an additional $300 million in Housing and Urban Development grants for the island territory.

The breakthrough came after Shelby and Sen. David Perdue (R-Ga.) spoke with Trump over the phone earlier Thursday afternoon as Republicans jockeyed to get the White House's support for a pared-down disaster only bill.

Negotiators had been stuck for days over how much of the administration's $4.5 billion request for emergency border money to include in a package. The thorny issue includes political landmines like Immigration and Customs Enforcement (ICE) and detention bed funding.

Democrats had agreed to include billions in humanitarian aid tied to the border, but rejected additional ICE or detention bed funding. Republicans, meanwhile, accused Democrats of trying to use the disaster bill to include new limitations on Trump's immigration actions.

Shelby suggested that lawmakers would try to pass the border money once they return from recess in June.

"We took it all out ... [but] we're going to try push that separately when we come back. It's needed, but we're sticking with disaster now," Shelby said.

The agreement is a U-turn from Wednesday evening, when lawmakers looked increasingly likely to have to punt the disaster aid deal into June amid the immigration fight. Senate Majority Leader Mitch McConnell (R-Ky.) warned on Thursday that he would force a vote regardless of whether there was an agreement, increasing pressure on negotiators.