The Senate on Wednesday overwhelmingly approved a bipartisan $4.5 billion bill to combat the escalating humanitarian crisis on the southern border, moments after rejecting a House version over its restrictions on enforcement efforts -- setting up a race to reconcile the two measures before Congress leaves town.

The Senate bill passed 84-8. That vote in the Republican-controlled chamber came minutes after the House version was voted down 55-37.

HOUSE LAWMAKERS TRADE ACCUSATIONS AMID SCRAMBLE TO PASS $4.5B BORDER BILL: 'PLAYING GAMES'

It's unclear what will come next. The Senate vote could put pressure on the Democrat-controlled House to pass its version before Congress breaks for the July 4 recess. Or the two chambers could try and hash out their differences in what is known as a conference committee.

Asked if they might consider this step, Senate Majority Leader Mitch McConnell, R-Ky., wouldn't say but vowed: "We're going to get this done."

The House legislation included what proponents called “guardrails” to stop funding being used for immigration enforcement. Funding for Immigration Customs and Enforcement (ICE) detention beds and Pentagon assistance to Department of Homeland Security (DHS) enforcement was not included in the House bill, while the latter and some ICE funding was included in the Senate version.

McConnell called the House bill a “go-nowhere proposal filled with poison pill riders which the president has indicated he would veto.” The White House had issued a warning on Monday saying the president would veto the measure if it landed on his desk, saying that it underfunds necessary departments and includes "policy provisions that would make our country less safe."

“They had to drag their bill way to the left to earn the support of most Democrats,” McConnell said. “As a result, the House has not made much progress toward actually making a law, just more resistance theater."

It is not clear if the Senate bill has the votes to pass the House. Many House progressives, four of whom voted against the House version, would likely oppose the Senate version over concerns that it doesn't do enough to stop the Trump administration immigration policies.

Rep. Veronica Escobar, D-Texas, told Fox News that “the guardrails have to be there” to stop the president from using it for enforcement.

“[Trump] is an untrustworthy president. He will use [the funds] in nefarious ways...giving him a blank check is dangerous,” she said.

DEM-LED HOUSE PASSES $4.5 B BILL TO AID MIGRANTS AT THE BORDER, SETTING UP SHOWDOWN WITH GOP-LED SENATE

Reps. Alexandria Ocasio-Cortez, D-N.Y., Ilhan Omar, D-Minn., Rashida Tlaib, D-Mich., and Ayanna Pressley, D-Mass., voted against the House measure on Tuesday, and that number would likely swell if the Senate version in its current states goes before the House. But House Minority Leader Kevin McCarthy, R-Calif., and others have suggested they would be willing to accept the Senate bill.

The congressional back-and-forth comes amid fresh scrutiny about poor conditions on the border as hundreds of thousands of migrants try and cross the border every month. An image of a drowned father and his daughter published late Tuesday and new reports of crowded and unsanitary conditions at border detention centers have increased pressure on Congress to grant the funding.

Members could also run out of time trying to blend the two bills together in committee, unless they postpone the recess. Lawmakers on both sides of the aisle understand that it is a problem for Congress to leave for a break without having produced a bill for Trump to sign.

Trump has urged Congress to act on the crisis, calling for both funding for the humanitarian crisis and legislation to close loopholes in the U.S. immigration system that make it harder to detain and deport illegal immigrants, particularly family units and unaccompanied minors.

Trump spoke with House Speaker Nancy Pelosi, D-Calif., on Wednesday afternoon, in an effort to try and reconcile the House and Senate supplementals. He told reporters he was hopeful that lawmakers in both chambers would find a way to get something to his desk that he would sign.

CLICK HERE FOR THE FOX NEWS APP

"Hopefully they can get something done," he said. "It's humanitarian aid, it's very important and I think that a lot of people are starting to realize that I was right when I said we have a crisis at the border."

House Majority Leader Steny Hoyer, D-Md., told reporters that he hopes that the Senate would agree to incorporate some elements of the House border bill. Asked if they can get it done before Congress heads off for recess, he said: “Hopefully.”

Fox News’ Chad Pergram, Mike Emanuel, Vandana Rambaran and The Associated Press contributed to this report.