The Senate passed a long-awaited foreign aid package for Ukraine and Israel early Tuesday morning, delivering a bipartisan endorsement of the legislation after months of negotiations, dire battlefield warnings and political mudslinging. But the measure faced a buzz saw of opposition in the House, where Republican resistance threatened to kill it.

The 70-to-29 vote reflected a critical mass of support in Congress for the $95 billion emergency aid legislation and for continuing to arm Ukraine in its fight against Russian aggression. The measure would provide an additional $60.1 billion for Kyiv — bringing the total U.S. investment in the war effort to over $170 billion — as well as $14.1 billion for Israel’s war against Hamas and almost $10 billion for humanitarian aid for civilians in conflict zones, including Palestinians in Gaza.

But it also splintered Republicans and foretold a bumpy road ahead in the G.O.P.-led House, where the speaker suggested late Monday that he would not act on it.

Twenty-two Senate Republicans voted with almost all Democrats for the bill — five more than had helped it over a final procedural hurdle on Monday night — while the rest of the party argued against continuing to fund a foreign nation’s battle to protect its sovereignty without first cracking down on an influx of migration into the United States across its border with Mexico.

The vote took place after an all-night Senate session in which a parade of Republican opponents made speeches denouncing various aspects of the bill.

Republican hostility to the measure has been egged on by former President Donald J. Trump, who encouraged G.O.P. senators to reject an earlier version that would have included a bipartisan border security deal, and Speaker Mike Johnson.