The House on Thursday passed a bill that would fund the government until Jan. 19 and sent the legislation to the Senate, where Democrats will be required to vote with Republicans to clear the bill by midnight Friday in order to avert a partial government shutdown.

The bill passed 231-188, and that decision, along with an easier 251-169 vote to approve $81 billion in new disaster aid, marked the end of major business in 2017 for House lawmakers. They planned to leave town Thursday evening and not return until Jan. 3.

Lawmakers passed the spending bill mostly along party lines, although a handful of Republicans voted against it, and several Democrats voted for it. Still, most Democrats opposed it in part because it did not include language legalizing so-called Dreamers who arrived in the United States as children.

The legislation extends until Jan. 19 a key counter-terrorism tool that lawmakers in both parties are eager to reform next year. It includes a patch to continue funding for the Children's Health Insurance Program through March and some additional funding for defense spending.

And, it incorporates a waiver to prevent more than $100 billion in mandatory spending cuts from going into effect in 2018. That language was needed to avoid required cuts under the 2010 Statutory Pay-As-You-Go law, which makes spending cuts mandatory if the deficit reaches a certain threshold. The tax bill is expected to raise the deficit by more than $1 trillion.

Congress has triggered the law before, but has always gotten a waiver. There have been 16 “pay go” waivers since its passage in 2010.

Republicans rounded up enough support to pass the bill despite abandoning a plan to include full fiscal 2018 defense spending.

GOP lawmakers decided to go along after appropriators added language that would give the defense department the ability to fund some key initiatives, including ship repairs.

Defense Secretary Jim Mattis and President Trump gave the spending plan their approval, bringing along defense hawks and other conservatives who initially planned to oppose it.

Republicans were also eager to avoid a shutdown fight that would distract from the passage of tax reform on Wednesday, which was a key legislative win for the party.

“We could have the government shut down after a big victory and that’s going to hurt our military more than any other part of government,” Rep. Bill Flores, R-Texas, told the Washington Examiner. “I didn’t think that was fair."