WASHINGTON (AP) — Negotiators in Congress say they have reached an agreement in principle to fund the government and avoid another partial government shutdown.

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.

The talks had cratered over the weekend because of Democratic demands to limit immigrant detentions by federal authorities, but lawmakers apparently broke through that impasse Monday evening.

Three people familiar with Congress’ tentative border security deal tell The Associated Press that the accord would provide $1.375 billion to build 55 miles of new border barriers.

That’s well below the $5.7 billion President Donald Trump demanded to build over 200 miles of wall along the Mexican boundary. The money will be for vertical steel slats called bollards, not a solid wall.

Democrats dropped their proposal to limit the number of detained immigrants caught inside the U.S. to a daily average of 16,500. Republicans opposed that demand. There is currently no such limit.

Bargainers agreed to fund 40,520 beds to detain immigrants entering or in the U.S. illegally. That’s the same number funded last year, though the actual figure held is around 49,000.

The sources described details of the still-secret agreement only on condition of anonymity.

Now they will need the support of President Donald Trump, whose signature will be needed ahead of the deadline at midnight Friday.

If lawmakers don’t act, hundreds of thousands of federal workers will be furloughed for a second time this year.