The House on Thursday passed a $790 billion spending package for fiscal year 2018 that funds the military and other security-focused departments, as well as a portion of the financing needed to complete 74 miles of a wall along the southwestern border.

The legislation garnered opposition from Democrats who opposed domestic spending cuts made in the bill as well as the $1.6 billion added for building the border wall, which was a top campaign promise made by President Trump.

The bill includes funding for the nation's defense, homeland security, energy, and water as well as military construction and veterans' affairs. It passed 235-192.

The legislation includes four of the 12 appropriations measures that would fund the federal government next year, and passed as House lawmakers anticipated departing for a five-week recess.

"This four-bill package is carefully crafted to fund our critical military priorities, reinforce our nuclear deterrents, support veterans, and make our borders more secure and strengthen protections for our constituents and for members," said House Appropriations Committee Chairman Rodney Frelinghuysen, R-N.J.

While Trump promised during the campaign that Mexico would pay for the border wall, supporters of the extra funding supported the additional expenditure.

"The best thing we can do as a good neighbor to Mexico is build that wall where it is needed," said Rep. Louie Gohmert, R-Texas. He added that the barrier would help "stop the flow of drugs" that have empowered the nation's deadly drug cartels.

But Democrats said the wall would be ineffective and divisive.

"Not only is it costly and useless, it will do more to divide America than keep us safe," said Rep. Darren Soto, D-Fla.

The legislation faces uncertain future.

The Senate isn't likely to consider the House bill because Democrats in the upper chamber will filibuster the measure.

The House and Senate are instead poised instead to pass a short-term measure at the end of the year that is part of a broad agreement between both parties to undo federal budget caps on both domestic and military spending. However, elements of the House-passed bill could make it into the final spending bill by the end of the fiscal year in September.

The House security spending package exceeds the caps by $72 billion.