House Republicans on Thursday passed a bill to keep the federal government funded until Feb. 16, sending the legislation to a possible defeat in the Senate later tonight.

Republicans passed the bill after an internal fight over military spending and immigration reform that they resolved about an hour before the vote.

Lawmakers passed it 230-187 — six Democrats voted for it, and 11 Republicans voted against it.

House Republicans secured the votes for the legislation after Republican leaders promised to call up a conservative immigration reform bill authored by Reps. Bob Goodlatte, R-Va., and Raul Labrador, R-Idaho. They also promised to take up a bill in the next few weeks that would provide a year's worth of funding for the defense department, which has endured significant budget cuts that defense hawks argue have hurt readiness.

President Trump personally got involved in the negotiations, phoning reluctant conservatives as they huddled over the bill earlier today.

The bill also delays several Obamacare taxes, and includes a six-year reauthorization of the Children’s Health Insurance Program, language that the GOP hoped would attract some Democrats.

But House Democrats called the bill “a farce” and “a partisan approach” and tried to shift the blame for a government shutdown to the GOP.

“No one is going to believe we are at fault,” Rep. Louise Slaughter, D-N.Y., said, citing poll numbers that indicate the GOP would be blamed for a shutdown.

Still, House passage gives the GOP leverage over the Democrats in the spending battle, and puts pressure on Senate Democrats to support it, or watch the government partially shut down after Friday.

If Senate Republicans all vote for the bill, it will be up to Democrats to decide whether to provide the votes needed to advance the bill in the upper chamber or risk being blamed for a partial government shutdown that would result if no funding is provided.

Senate Democrats claimed Thursday they were united in opposition to the measure and would block it. And at least four Senate Republicans have also threatened to vote against the measure.

Senate Republican leaders warned lawmakers they would remain in session over the weekend if the bill does not pass and would call votes on the same spending bill again and again, until it passes.

Democrats are opposed to the spending bill for several reasons. They want a long term deal that includes important items on their wish list, such as funding for battling the opioid epidemic and community health centers.

Democrats are also seeking a favorable deal to protect so-called Dreamers, who came here illegally as children.

Republicans, Democrats, and Trump administration officials have been meeting for weeks to try to work out a deal that would be considered in separate legislation. GOP lawmakers are optimistic an accord is possible by a March 5 deadline, but Democrats say the talks have gone nowhere, and want language for Dreamers included today.