Lawmakers introduced a bill late Wednesday night to prevent a second partial shutdown days before the deadline.

Rep. Nita LoweyNita Sue LoweyAppropriators warn White House against clawing back foreign aid Pelosi: Israel's Omar-Tlaib decision 'a sign of weakness' Lawmakers blast Trump as Israel bars door to Tlaib and Omar MORE (D-N.Y.), chairwoman of the House Appropriations Committee, filed the legislation to fund approximately a quarter of the federal government roughly 48 hours before the funding lapse deadline. 

“We cannot repeat the disastrous government shutdown, so it is incumbent on Congress to come together to responsibly fund our government. This legislation represents a bipartisan compromise and will keep our government open while funding key priorities,” Lowey said.

The 1,159-page bill includes $1.375 billion for physical barriers along the U.S.-Mexico border — well below the $5.7 billion President TrumpDonald John TrumpO'Rourke: Trump driving global, U.S. economy into recession Manchin: Trump has 'golden opportunity' on gun reforms Objections to Trump's new immigration rule wildly exaggerated MORE has demanded.

ADVERTISEMENT

With the tight time frame, the Senate is expected to vote first on the funding deal, according to a Senate source. The House is then expected to vote on the agreement on Thursday evening and send it to President Trump's desk.

Trump has not said explicitly that he will sign the bill, though Republican lawmakers say they are optimistic he'll back it.

"My impression is he's likely to sign it but then to issue some sort of executive order to supplement those funds with other funds that Congress has already authorized him to tap," said Sen. John CornynJohn CornynThe Hill's Campaign Report: Battle for Senate begins to take shape The Hill's Morning Report — Trump and the new Israel-'squad' controversy O'Rourke says he will not 'in any scenario' run for Senate MORE (R-Texas), who traveled back from El Paso, Texas, with Trump earlier this week.

Sen. Richard ShelbyRichard Craig ShelbyIn-space refueling vs heavy lift? NASA and SpaceX choose both Budget deal sparks scramble to prevent shutdown Trump border fight throws curveball into shutdown prospects MORE (R-Ala.), chairman of the Appropriations Committee, added in a tweet Wednesday evening that he had spoken with Trump recently, characterizing the president as being in "good spirits." 

Rep. Tom GravesJohn (Tom) Thomas GravesGOP scores procedural win by securing more funding to enforce Iran sanctions Bipartisan bill would enable companies to defend themselves against cyberattacks Republicans spend more than million at Trump properties MORE (R-Ga.) said early Thursday morning that he did not sign the conference report, adding that he was given only an hour to review the 1,159-page bill.

"With 30 minutes notice, I was allowed 1 hour to review and had to make a choice. I could not sign off," he tweeted shortly after midnight.

Only a simple majority of both House lawmakers and Senate lawmakers on a conference committee need to sign the report.

The funding agreement comes after lawmakers and staffers were still haggling earlier Wednesday about a handful of outstanding issues, including the type of physical barriers that could be used along the border and some of the locations. 

A congressional Democratic aide said the funding bill would only allow the administration to use "existing technologies" for fencing and barriers. The legislation specifies that the barrier funding would have to be "pedestrian fencing" or "levee pedestrian fencing" in the Rio Grande Valley Sector.

It would also prohibit fiscal 2019 or previous years' funding from being used to construct pedestrian fencing in the Santa Ana Refuge, La Lomita Historical Park, Bentsen-Rio State Park, National Butterfly Center, the Vista del Mar and other points east.

Back pay for federal contractors impacted by the shutdown and an extension of the Violence Against Women Act were both left out of the bill

According to a summary of the bill, it would also prohibit the Department of Homeland Security (DHS) from blocking lawmakers from "entering any facility that is used to detain or otherwise house children" or making changes "to the current operations and facility conditions in anticipation of a congressional oversight visit."

Lawmakers, including Sen. Jeff MerkleyJeffrey (Jeff) Alan MerkleySenate Democrats push Trump to permanently shutter migrant detention facility Senate Dem seeks answers from DHS on reports of pregnant asylum seekers sent back to Mexico Schumer backs Pelosi as impeachment roils caucus MORE (D-Ore.), have previously said they were turned away when trying to enter detention facilities.

Lowey, in a statement submitted on behalf of the conference committee, said that under the bill, DHS is also directed to ensure that migrant families are "reunited and transferred together" before they are removed from U.S. Customs and Border Patrol (CBP) or transferred to Immigration and Customs Enforcement. The bill, according to the statement, would also encourage CBP to detain siblings in the same facility.

Niv Elis and Scott Wong contributed to this report. Updated at 1 a.m.