The House approves a bill to clear the way for massive spending increases and ends a brief government shutdown.

The House passed a bill Friday to set up a major spending increase and end a brief government shutdown, sending it to President Donald Trump for his signature. Both chambers of Congress passed a short-term funding bill and cleared the way for a boost to military and domestic spending hours after funding lapsed at midnight. The government partially shut down for the second time in less than a month. The massive legislation cleared Congress after opposition delayed or threatened its passage in both chambers. The House narrowly passed the budget bill by 240 to 186 before dawn Friday. Resistance to the plan came from the House's conservative and liberal wings. Some GOP conservatives objected to increased spending. Meanwhile, House Minority Leader Nancy Pelosi and other Democrats criticized the lack of a provision to protect hundreds of thousands of young immigrants from deportation.

"Democrats worked hard to achieve a bipartisan agreement and gave our assurances to the Speaker that we were not interested in shutting down government," Pelosi said in a statement after the vote. "In return, the Speaker refused to make a real commitment to schedule a vote to protect the Dreamers who have the overwhelming support of the American people and a bipartisan majority in the House." Hours earlier, the Senate approved the measure by a 71-28 vote following Sen. Rand Paul's repeated attempts to block the vote. The Kentucky Republican opposed the spending increases contained in the agreement and wanted to vote on an amendment to maintain budget caps. The bill would set up a two-year, $300 billion boost in spending on military and domestic programs. It would also extend the debt ceiling, authorize nearly $90 billion more in aid for last year's string of natural disasters, give funding to fight the opioid crisis and extend the popular Children's Health Insurance Program for an additional four years.

Senate Majority Leader Mitch McConnell (R-KY) walks from a vote on Capitol Hill after the senate voted to advance a bill financing the U.S government January 22, 2018 in Washington, DC. Brendan Smialowski | AFP | Getty Images

Trump, who said earlier this week he would "love" a government shutdown, was expected to sign the measure into law. He signaled his support for it in a tweet on Wednesday. "The Budget Agreement today is so important for our great Military," Trump wrote. "It ends the dangerous sequester and gives Secretary Mattis what he needs to keep America Great. Republicans and Democrats must support our troops and support this Bill!" Trump tweet In a statement Friday morning, House Speaker Paul Ryan called the budget deal "a great victory" for military service members. "Ultimately, neither side got everything it wanted in this agreement, but we reached a bipartisan compromise that puts the safety and well-being of the American people first," he said. The legislation funds the government through March 23 while lawmakers work on an appropriations bill with the levels set out by Congress. Congress will then have to pass appropriations legislation for the current fiscal year that ends Sept. 30 and the following year. The deal includes: A $165 billion increase in military spending;

A $131 billion boost to domestic program spending;

Nearly $90 billion in funding for disaster relief efforts in Texas, Florida and Puerto Rico;

Two years of funding for community health centers;

Another four-year extension of the Children's Health Insurance Program, for a total of a decade;

Funding for existing infrastructure programs related to transportation, drinking water and broadband. The budget deal's passage faced real threats on Wednesday and Thursday. Pelosi said she would vote against the bill unless Ryan gave assurances that he would allow an open debate on immigration legislation. Other Democrats followed suit. Self-professed fiscal hawks in the House also pushed back against the bill. House Freedom Caucus member Rep. Jim Jordan, R-Ohio, called it a "monstrosity." Similar concerns surfaced Thursday in the Senate, as several fiscal hawks voted against it. Paul mounted the most serious opposition, leading Senate Majority Whip John Cornyn to say he would "effectively shutdown the federal government for no real reason." "I can't in all good honesty, in all good faith, just look the other way because my party is now complicit in the deficits," Paul said on the Senate floor hours before the chamber voted.

Path forward on immigration unclear