WASHINGTON – Lawmakers negotiating to avoid another government shutdown reached an agreement "in principle" to keep federal agencies open after Friday, when current federal funding is set to expire.

The bipartisan group did not provide details of the agreement on Monday. However, congressional aides said it included $1.375 billion for a structure along the southern border – well below the $5.7 billion President Donald Trump has demanded for the wall that he made a central promise of his 2016 presidential campaign.

Congress has given enough funding to Immigration and Customs Enforcement to pay for 40,520 detention beds, but the agency has routinely exceeded that number, currently detaining closer to 50,000 immigrants per day. The deal would force ICE to return to that 40,520 number by the end of the year, representing a big drop for ICE. Those beds can be either on the border or in the interior of the country, according to a Democratic aide.

Democrats had hoped to create a cap of 16,500 beds in the interior, which would have put the number of detention beds closer to 35,000 overall. But there will be no cap in the total number, according to the Democratic aide. A GOP aide said there was enough flexibility in the deal that the number of beds can rise significantly if needed.

Speaking at a political rally in El Paso, Texas, shortly after the deal was announced, Trump spoke at length about border security and continued to argue for a wall.

He did not say whether he would sign the agreement to avert a shutdown if it reaches his desk.

"They said progress is being made," Trump said, referring to aides who briefed him before he began speaking in El Paso, where signs hanging from the rafters read: "Finish the wall."

"We probably have some good news. But who knows?" he said.

The emerging agreement was announced by a group of lawmakers, including Republican Sen. Richard Shelby and Democratic Rep. Nita Lowey, after a closed-door meeting on Capitol Hill.

"We're talking about serious, serious, serious things, and we're hopefully making some progress," Shelby, R-Ala., told reporters earlier at the Capitol after the group met for a second time Monday.

The Border Committee Democrats are behaving, all of a sudden, irrationally. Not only are they unwilling to give dollars for the obviously needed Wall (they overrode recommendations of Border Patrol experts), but they don’t even want to take muderers into custody! What’s going on?

The bipartisan group is part of a bicameral committee of appropriators selected to find a solution that can pass Congress and get support from the president before some of the government's funding lapses Friday at midnight.

"I don't think Democrats or Republicans want a shutdown. One option or another, we will resolve this," Lowey, D-N.Y., said earlier in the day.

Until this past weekend, the biggest sticking point for the group had been how to deal with the president’s demand for a $5.7 billion wall along the southern border. During the last shutdown, Democrats refused to give him the money, saying the wall would be costly and ineffective.

Last week, the bipartisan group explored a compromise involving some sort of structure, though the figures discussed were far less than Trump’s initial request.

On Sunday, the talks hit a snag amid disagreement over Democrats' demands for a cap on detentions by the U.S. Immigration and Customs Enforcement agency.

Democrats said ICE routinely detains more immigrants than it needs to, imprisoning those who don’t have criminal backgrounds and pose no threat to national or domestic security. That’s why they want to set a hard cap on the number of immigrants ICE detains, the goal being to force the agency to focus its resources on violent criminals.

“This agency needs checks and balances, so the Republicans want to get more wall money and Democrats want to get controls on ICE. This is what a negotiation looks like,” said Kerri Talbot of the advocacy group Immigration Hub.

Republicans said a detention cap would force the release of undocumented immigrants in custody and warned of the risk that many might not show up for scheduled hearings on whether they should be deported.

In a tweet Monday morning, Trump accused the Democrats of a brand new demand, and he told reporters ICE was "very disrespected by the Democrats.”

The Democrats do not want us to detain, or send back, criminal aliens! This is a brand new demand. Crazy!