Lawmakers said on Monday night that they had reached an agreement "in principle" to avoid a second partial government shutdown set to begin on Saturday.

“We’ve had a good evening. We’ve reached an agreement in principle between us on the Homeland Security and the other six bills,” Sen. Richard Shelby Richard Craig ShelbySenate GOP eyes early exit Dems discussing government funding bill into February GOP short of votes on Trump's controversial Fed pick MORE (R-Ala.) told reporters.

Shelby announced the deal alongside Sen. Patrick Leahy Patrick Joseph LeahyBattle over timing complicates Democratic shutdown strategy Hillicon Valley: Russia 'amplifying' concerns around mail-in voting to undermine election | Facebook and Twitter take steps to limit Trump remarks on voting | Facebook to block political ads ahead of election Top Democrats press Trump to sanction Russian individuals over 2020 election interference efforts MORE (D-Vt.) and Reps. Nita Lowey Nita Sue LoweyTop House Democrats call for watchdog probe into Pompeo's Jerusalem speech With Biden, advocates sense momentum for lifting abortion funding ban Progressives look to flex their muscle in next Congress after primary wins MORE (D-N.Y.) and Kay Granger Norvell (Kay) Kay GrangerGOP women's group rolls out six-figure campaign for Ernst Bottom line Helping our seniors before it's too late MORE (R-Texas) — the top members of the Senate and House Appropriations committees.

The breakthrough came after the core four negotiators met three times on Monday night in a last-ditch effort to get a deal after talks appeared to unravel over the weekend with only days to prevent a partial government shutdown.

ADVERTISEMENT

Negotiators refused to discuss the particulars of the deal, with staff expected to work frantically to release the legislation as early as Tuesday. Lowey said she hopes for the bill, which she called a "good product," to be released on Wednesday.

A congressional source told The Hill that the bill will include $1.375 billion for physical barriers, the same amount included in the fiscal 2018 bill. The tentative agreement, according to the source, also specifically prohibits the use of a concrete wall. But, senior congressional aides separately noted that it will fund approximately 55 new miles of barriers along the U.S.-Mexico border in the Rio Grande Valley sector.

If negotiators are able to hold an agreement together it would mark a dramatic U-turn from earlier Monday, when both sides were still divided on two key issues: funding for physical barriers along the U.S.-Mexico border and a snag on Immigration and Customs Enforcement (ICE) detention beds.

Lawmakers refused to discuss how they resolved the ICE fight, after Democrats proposed a cap on the number of ICE detention beds, arguing it would force the Trump administration to focus on “serious criminals,” and that numbers were in line with those from the Obama administration.

"We worked it out in principle. We think it's going to work," Shelby said.

Democrats appear to have dropped their demand to cap the number of ICE detention beds in the interior of the country, away from the border, at 16,500.

But in a sign of the potential hurdles to the agreement, there seemed to be mixed signals on other details of the ICE provisions on Monday night.

A congressional aide said the deal included 40,520 ICE detention beds. But senior congressional aides argued that the tentative agreement included "enough flexibility to reach the president's requested level of 52,000 beds."

ADVERTISEMENT

Shelby said the agreement includes funding for physical barriers along the U.S.-Mexico border, but declined to say how much is included or whether it's more than the $1.6 billion included in the Senate's initial Homeland Security bill.

Trump has demanded $5.7 billion for the U.S.-Mexico border wall. But the larger group of 17 lawmakers tasked with spearheading a deal had narrowed the funding gap to between $1.3 billion and $2 billion as of late last week.

Lawmakers said on Monday night that they have the support of their respective leadership teams to strike a compromise.

"There's not a single one of us who's going to get every single thing we want, but nobody does. But we are going to get what is best for the United States," Leahy said.

"If the four of us couldn't get it together, this Congress never could," he added.

The group left the sticking point of disaster aid off the table, and said they would address it separately, but that they expected to include all seven remaining appropriations bills in the package.

Congress has until Saturday to get the seven remaining fiscal 2019 appropriations bills to Trump's desk to fund roughly 25 percent of the federal government, including the Department of Homeland Security.

The Monday night deal will leave them a tight time frame if they are going to get an agreement to Trump's desk before the deadline.

But Shelby downplayed the chances of missing the Friday night cutoff, telling reporters that he didn't think there would be another partial government shutdown later this week.

Lawmakers have shown little appetite for a second partial shutdown after Trump agreed to sign a three-week continuing resolution late last month that ended the longest funding lapse in U.S. history.

Shelby, asked what prompted Monday night's breakthrough, pointed to the growing fear over the weekend that the stalemate in talks would spark another shutdown.

"All of us realized us that we had a bigger obligation to get back together. I didn't know if it would happen," he said. "I think the fact that it looked like there was going to be another shutdown imminently probably helped contribute to us getting together."

There were signs that a breakthrough was imminent earlier Monday evening when Shelby and Leahy, standing side by side as they spoke to reporters, said they were closing in on a deal and could wrap up talks before Tuesday.

"We’re talking about reaching an agreement on all of it," Shelby told reporters.

Though negotiators reached the agreement "in principle" on Monday night, there could still be political landmines they will need to navigate around before Trump signs the agreement, including potential rifts in both parties.

Progressive Democrats may not want to cast votes to fund any measure of physical barriers, while conservative Republicans could balk at any potential limits on ICE or details they see as too soft on border security.

"I think all of us have talked to our different constituencies and different colleagues," said Granger, expressing confidence that the deal would pass.

It also wasn't immediately clear if Trump would support the agreement.

Shelby said that while the White House had been consulted throughout the process, he hadn't talked with the president, who was holding a campaign rally along the border on Monday evening, since Thursday.

He added that while he couldn't predict what Trump will "do, say [or] write" the president told him "more than once that if you can work out a legislative solution to this, do that."

Trump has floated declaring a national emergency to construct the U.S.-Mexico border wall if Congress wasn't able to reach a deal. And White House chief of staff Mick Mulvaney Mick MulvaneyMick Mulvaney to start hedge fund Fauci says positive White House task force reports don't always match what he hears on the ground Bottom line MORE floated over the weekend that the administration could look for ways to supplement money for the wall.

“We'll take as much money as you can give us and then we will go off and find the money someplace else, legally, in order to secure that southern barrier. But this is going to get built with or without Congress,” Mulvaney told “Fox News Sunday.”

One GOP lawmaker who has been involved with the negotiations said he believes the president will likely take executive action to secure funding for the barrier.

"I think the president will ultimately take other actions no matter what product comes out of that meeting," the lawmaker said.

— Juliegrace Brufke and Niv Elis contributed to this report, which was updated at 10 p.m.