A bipartisan group of senators has agreed on a compromise to crack down on the surge of migrants across the United States border with Mexico, including reducing the number who are allowed to live and work in the country temporarily, but a final deal depends on resolving critical funding disputes.

Much of the recent haggling over the emerging agreement — and a point of contention for its critics — has been about how to limit the number of people who are granted parole, a status that allows migrants without visas to live and work in the United States temporarily. Drawing broader support for the plan in the Senate would clear away the biggest obstacle to congressional approval of tens of billions of dollars in aid to Ukraine for its war against Russian aggression, which Republicans have said they will block absent a deal to clamp down at the border.

The G.O.P. considers parole a dangerous loophole that fuels illegal immigration and must be tightly closed. To many Democrats, it is a crucial tool that allows the administration to treat desperate migrants humanely, which must be preserved, particularly for vulnerable populations fleeing failing states and war.

Bridging the gap will likely hinge on the two sides agreeing on how much federal money to spend to try to decrease net immigration numbers, and persuading Republicans that the deal’s measures will be effective. On Monday, Senate leaders warned that getting a final deal depended on resolving those remaining differences.