“We believe that we’re where we need to be on this,” Mr. Shelby told reporters. “We feel good with where we are.”

All four lawmakers declined to offer details about the legislation, and indicated that staff members would work through the weekend on specific text, possibly waiting until Monday to describe how lawmakers proposed to allocate the funding.

But people familiar with the agreement, which has not yet been completed, said its current version would maintain existing levels of funding for Mr. Trump’s border wall, devoting $1.375 billion to border barrier construction, and placing no limitations on his ability to transfer funds from other Pentagon accounts.

Still, the agreement will not replace the $3.6 billion in military construction funds that the White House directed toward the border wall, according to two people familiar with the tentative deal, which they described on the condition of anonymity because it was not final.

A federal court late Tuesday also blocked Mr. Trump from using those funds to build a wall, which is likely to be challenged.

The group announced the tentative deal in the same alcove just outside the Capitol rotunda where, 10 months ago, after the nation’s longest government shutdown, they announced an initial agreement over the president’s wall and the remainder of government funding. The memory of that 35-day experience hung over the negotiations, serving as a cautionary tale for the White House and leaders in both parties if they failed to reach an agreement.

“I can feel confident that we will get legislation passed before we leave, and the country will be better off for it,” Mr. Leahy said. “Everybody worked very hard.”