“I have said many times before, standing in this exact spot, that a continuing resolution is a last resort,” Representative Harold Rogers, Republican of Kentucky and chairman of the House Appropriations Committee, said on the House floor, referring to the short-term spending bill. “But at this point, it is what we must do to fulfill our congressional responsibility to keep the lights on in our government.”

After the Senate passed the measure Wednesday afternoon, House leaders quickly worked to schedule their vote for the evening. The bill passed despite opposition from some conservatives who objected to additional spending, as well as from a number of Democrats who remained skeptical that Republicans would fully appropriate the money for Flint when lawmakers returned after the election.

The deal that unclogged the pipeline came from an unlikely place: the House of Representatives. The agreement hinges on an amendment to a water projects bill, the Water Resources Development Act, which would authorize $170 million in spending to communities such as Flint where the president has declared a state of emergency because of contaminants like lead. A version of that bill, which approved more than $200 million for Flint and other poor communities struggling with lead contamination, passed the Senate this month.

The House passed that bill earlier Wednesday evening, setting up a meeting between congressional leaders to resolve the differences between the Senate and House versions of the water projects legislation, discrepancies that include the amount of funding for Flint and whether the funding is set aside or simply authorized.

But that conference meeting is not expected to happen until lawmakers return after the election, which left some Democrats uneasy. The 45-member Congressional Black Caucus recently vowed to oppose any stopgap spending bill that did not include funding for Flint.

The group’s chairman, Representative G. K. Butterfield, Democrat of North Carolina, said they were disappointed that Democratic leaders had agreed to a deal that relied primarily on the word of their Republican counterparts.

“The question is, are we willing to accept the promise of the Republican leadership that it will come out in conference?” he said in an interview Wednesday.