President Donald Trump signed a major budget plan into law Friday, ending the year's second government shutdown hours after it started.

Both chambers of Congress passed a short-term funding bill in the wee hours of Friday and cleared the way for a massive 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, then sent it to Trump.

Trump tweeted Friday morning that he signed the legislation.

"Just signed Bill. Our Military will now be stronger than ever before," the president wrote. "We love and need our Military and gave them everything — and more. First time this has happened in a long time. Also means JOBS, JOBS, JOBS!"

Trump tweet

Conservative and liberal lawmakers mounted resistance to the plan. Some GOP conservatives objected to increased spending and argued that it would recklessly increase budget deficits. 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.

The Senate approved the measure by a 71-28 vote early Friday 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 sets up a two-year, $300 billion boost in spending on military and domestic programs. It also extends the debt ceiling, authorizes nearly $90 billion more in aid for last year's string of natural disasters, gives funding to fight the opioid crisis and extends the popular Children's Health Insurance Program for an additional four years.