Congressional negotiators revealed Monday evening that they’ve reached “an agreement in principle” on border security funding that includes more than $1.3 billion for physical barriers along the U.S.-Mexico border.

When asked if they had an agreement that President Trump would approve, Sen. Richard Shelby, R-Ala., the chairman of the Senate Appropriations Committee, told reporters: “We think so. We hope so.” Rep. Nita Lowey, D-N.Y., the chair of the House Appropriations Committee, declined to give details of the deal but said a final text could be released by Wednesday.

Lawmakers have until 11:59 p.m. Friday to get the agreement through both houses of Congress and signed by Trump before several Cabinet-level departments shut down and hundreds of thousands of federal workers are furloughed in what would be the second partial government shutdown this year.

Sources tell Fox News the $1.3 billion can be used only for new construction that would cover approximately 55 miles of border territory in the Rio Grande Valley.

The White House had requested $5.7 billion for the border wall and the administration had dangled the possibility that Trump would declare a national emergency and divert money from the federal budget for wall construction, but that move almost certainly would be challenged in Congress as well as in the courts.

TRUMP HOLDS RALLY IN TEXAS AMID BORDER WALL DEBATE

Talks nearly collapsed over the weekend after Democrats pushed to reduce funding for detention beds to curb what they’ve called unnecessarily harsh enforcement by Immigration and Customs Enforcement (ICE). A proposal to cap at 16,500 the number of detainees caught in areas away from the border — a limit Democrats said was aimed at preventing ICE overreach — ran into its own Republican wall.

Shelby told reporters Monday night that the bed issue had been worked out, but declined to give details. “We think it’s going to work,” he said. “We had some hard negotiations.”

Sources told Fox News the agreement would provide enough money for 42,774 adult and 2,500 child beds with the goal of reducing that number to approximately 40,250 by the end of September. However, the White House has the ability to shift some money in the bill without a congressional blessing in order to provide more money for the wall or more detention beds. With that in mind, sources tell Fox News the total number of beds could go as high as 52,000, though there is no technical limit on the amount.

According to ICE figures, 66 percent of the nearly 159,000 immigrants it reported detaining last year were previously convicted of crimes. In 2016 under President Obama, around 110,000 immigrants were detained and 86 percent had criminal records.

CLICK HERE TO GET THE FOX NEWS APP

At a campaign-style rally Monday night in El Paso, Texas, Trump said he was told lawmakers were making progress in their bid to avert another shutdown. However, the president told his staff that he didn’t want to hear about it and that it was important to speak “to my people from Texas” first.

“I had a choice,” Trump said. “I could’ve stayed out there and listened, or I could have come out to the people of El Paso and Texas, I chose you.”

Fox News’ Chad Pergram Mike Emanuel and The Associated Press contributed to this report.