The House passed a stopgap government funding measure Thursday night in a 217-185 vote that includes $5.7 billion for President Trump's wall on the Mexican border and additional security - raising the odds that a shutdown will begin Friday at midnight.

Passage of the measure over united Democratic opposition passes the hot potato to the Senate, which is set to consider the bill Friday. The bill is not expected to pass the Senate, where Democrats have rejected money for Trump's wall.

Eight Republicans voted against the bill, which was approved by the House a day after the Senate approved a similar measure that also funds the government through Feb. 8 but does not include the money for Trump's wall. That bill was approved by voice vote.

"The bill that's on the floor of the House, everyone knows, will not pass the Senate," Senate Minority Leader Charles Schumer (D-N.Y.) said moments before the House approved the measure.

Pressed on the odds of a government shutdown after the House vote, senior appropriator Tom Cole (R-Okla.) told reporters: "They are certainly higher than they were this morning."

Passage of the bill capped a wild day at both ends of Pennsylvania Avenue.

Republicans started the day planning to hold a vote on the stopgap measure approved Wednesday night by the Senate. But they reversed course after Trump said he would not sign that bill.

Top Republicans gathered with Trump at the White House on Thursday afternoon, where the president asserted he would not sign legislation that didn't include the $5 billion in wall funding he requested.

Conservatives in the House had also rejected the measure, arguing to their leaders that it would be nearly impossible to secure wall funding after Democrats take back the House majority in January.

During a raucous, closed-door conference meeting Thursday morning, Republican after Republican stood up at the open mics and expressed outrage over leadership's initial play call. Members credited that internal revolt with leadership's decision to consider attaching border wall funding and disaster aid to the package.

"100 percent of the people who stood up and spoke said they want to stay and fight," said Rep. Barry Loudermilk (R-Ga.). "And leadership listened."

House Majority Leader Kevin McCarthy (R-Calif.) indicated the House-passed legislation could be a place to start negotiations with the Senate. The California Republican said he believes there is still time for them to hash out a deal before the partial government shutdown goes into effect.

"We have time right now to get it done. I've watched these bodies move rather rapidly when they want to. I've watched the Senate argue about 60 votes and all that and they were able to voice vote a [continuing resolution]," he told reporters.

Members of the Republican Study Committee, who huddled ahead of the vote, said they are prepared to stay through the holidays if it means securing wall funding.

"We'll decide when it comes back over, but I think the resolve of this group is to send it right back to them and continue the volley because we feel like this is a non-negotiable that we've got to protect it," Republican Study Committee Chairman Mike Johnson (R-La.) told The Hill.

Melanie Zanona contributed.