A government shutdown still looms even as the House passed a four-week stopgap funding bill Thursday evening, sending the measure to the Senate, where prospects for its passage remain grim.

House Republicans put up the needed votes to pass the continuing resolution before a handful of Democrats added their “yes” votes, for a final tally of 230-197.

A senior Senate Democratic aide said the House support for the CR does not change the caucus’s position to vote against it in the Senate.

Up until around 6 p.m. Thursday the House also did not have the votes needed to pass the CR, but reluctant Republicans got on board after House GOP leaders negotiated a deal with Freedom Caucus leaders Mark Meadows and Jim Jordan for upcoming votes on defense spending and immigration. President Donald Trump was also involved in the dealmaking, Meadows said.

Watch: Pelosi and Ryan Discuss Shutdown Possibility

Specifically, the Freedom Caucus secured a commitment for two votes.

The first, on a defense funding bill, will occur within the next 10 legislative days, Meadows said. (The House has a congressional recess scheduled for next week.)

That measure would include language to raise the $549 billion sequestration spending cap on defense funding for fiscal 2018 to the level Congress approved in the National Defense Authorization Act — a roughly $80 billion increase — and then appropriate that money, Meadows said.

The second vote leaders committed to would be a conservative immigration bill and would occur before Feb. 16, the end date in the CR, Meadows said. He said he expects that vote would largely mirror a bill by House Judiciary Chairman Robert W. Goodlatte but with some changes related to visas for agricultural workers.

The Goodlatte bill would fund Trump’s requested border wall, end the diversity visa lottery program and terminate extended family visas. It also provides a three-year renewable status for current recipients of the Deferred Action for Childhood Arrivals program, which protects some 700,000 young undocumented immigrants from deportation.

Although the commitments for votes on the defense and immigration bills do not extend beyond the House, effectively changing nothing, Meadows said there are “subplots that I’m not articulating right now that we did get.”

“We negotiated the best deal that we felt that we could get under the current circumstances,” he said.

While the deal does not involve a commitment to a Senate vote on the defense bill, Meadows said his understanding is that Speaker Paul D. Ryan has discussed that with Senate Majority Leader Mitch McConnell and he believes “it’s different this time,” a reference to similar defense funding measures the House has passed and the Senate has ignored.

As the CR heads to the other side of the Capitol, GOP leaders are taking aim at Senate Minority Leader Charles E. Schumer. “The only people standing in the way of keeping the government open is Senate Democrats,” Ryan said. “They fully intend to shut down the government unless they get their way.”

House Majority Leader Kevin McCarthy added, “Either we stay open or we have a Schumer shutdown.”