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

Rep. Nita LoweyNita Sue LoweyThe Hill's 12:30 Report: Roger Stone gets over three years in prison; Brutal night for Bloomberg Three members of Congress endorse Bloomberg after raucous debate Overnight Defense: Senate votes to rein in Trump war powers on Iran | Pentagon shifting .8B to border wall | US, Taliban negotiate seven-day 'reduction in violence' 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 TrumpWhere do we go from here? Conservation can show the way Gov. Ron DeSantis more popular in Florida than Trump Sotomayor accuses Supreme Court of bias in favor of Trump administration 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 CornynOcasio-Cortez announces slate of all-female congressional endorsements Trump Medicaid proposal sparks bipartisan warnings Senate braces for fight over impeachment whistleblower testimony MORE (R-Texas), who traveled back from El Paso, Texas, with Trump earlier this week.

Sen. Richard ShelbyRichard Craig ShelbyOn The Money: Republicans expect Trump to pull controversial Fed nominee | Inside Judy Shelton's confirmation hearing | Trump extends emergency declaration at border Republicans expect Trump to withdraw controversial Fed nominee Pentagon transferring .8 billion to border wall 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 GravesThe Hill's Morning Report — Pelosi makes it official: Trump will be impeached Republican Tom Graves announces retirement from House Lawmakers skeptical of progress on spending deal as wall battle looms 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 MerkleyInterest rate caps are popular — for good reason Overnight Energy: EPA to regulate 'forever chemicals' in drinking water | Trump budget calls for slashing funds for climate science centers | House Dems urge banks not to fund drilling in Arctic refuge Democratic senators criticize plan that could expand Arctic oil and gas development 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.