With Trump's halfhearted signature widely expected but hardly guaranteed, congressional leaders planned votes Thursday on the sweeping package. Passage first by the Republican-led Senate, then the Democratic-controlled House, was virtually certain, with sizable numbers of both parties' members set to vote "yes." Bargainers formally completed the accord moments before midnight Wednesday.
"I'm sure it's going to pass. I don't know of any drama," said House Democrats' chief vote-counter, Rep. James Clyburn, D-S.C.
Trump's assent would end a raucous legislative saga that commenced before Christmas and was ending, almost fittingly, on Valentine's Day. The low point was the historically long 35-day partial federal shutdown, which Trump sparked and was in full force when Democrats took control of the House, compelling him to share power for the first time.
When Trump yielded Jan. 25 after public opinion turned against him and congressional Republicans, he'd won not a nickel of the $5.7 billion he'd demanded for his wall but had caused missed paychecks for legions of federal workers and federal contractors and lost services for countless others. It was a political fiasco for Trump and an early triumph for House Speaker Nancy Pelosi, D-Calif.
The fight left both parties dead set against another shutdown. That sentiment weakened Trump's hand and fueled the bipartisan deal, a pact that contrasts with the parties' still-raging differences over health care, taxes and investigations of the president.
The product of nearly three weeks of talks, the agreement provides almost $1.4 billion for new barriers along the boundary. That's less than the $1.6 billion for border security in a bipartisan Senate bill that Trump spurned months ago, and enough for building just 55 miles of barricades, not the 200-plus miles he'd sought.
Notably, the word "wall" — which fueled many a chant at Trump campaign events and rallies as president — does not appear once in the 1,768 pages of legislation and explanatory materials. "Barriers" and "fencing" are the nouns of choice.
The compromise would also gradually pressure Immigration and Customs Enforcement, or ICE, to gradually detain fewer unauthorized immigrants. To the dismay of Democrats, it would still leave an agency many of them consider abusive holding thousands more immigrants than it did last year.
The measure contains money for improved surveillance equipment, more customs agents and humanitarian aid for detained immigrants. The overall bill also provides $330 billion to finance dozens of federal agencies for the rest of the year.
Trump has talked for weeks about augmenting the agreement by taking executive action to divert money from other programs for wall construction, without congressional sign-off. He might declare a national emergency, which has drawn opposition from both parties, or invoke other authorities to tap funds targeted for military construction, disaster relief and counterdrug efforts.
Those moves could prompt congressional resistance or lawsuits, but would help assuage supporters dismayed that the president is yielding.
Rep. Mark Meadows, R-N.C., who leads the hard-right House Freedom Caucus, told reporters "it would be political suicide" if Trump signs the agreement and did nothing else to find added money.
The measure was expected to be carried by pragmatists from both parties. Many of Congress' most liberal members were expected to oppose it, unwilling to yield an inch to Trump's anti-immigrant policies, while staunch conservatives preferred a bill that would go further.
"I made a promise to my community that I wouldn't fund ICE," said Rep. Alexandria Ocasio-Cortez, D-N.Y., a freshman who's become a face of her party's left wing and a leading proponent of eliminating the agency.
Though Trump lost the highest-profile issue at stake, he all but declared victory Wednesday.
At the White House, he contended that a wall "is being built as we speak." Work on a small stretch of barriers is due to start this month in Texas' Rio Grande Valley under legislation Congress approved last year.
Swallowing the deal would mark a major concession by Trump, who has spent months calling the situation at the southern border a national security crisis.
In private conversations, Trump has called the congressional bargainers poor negotiators, said a person familiar with the conversations who wasn't authorized to speak publicly. Trump has also made clear that he wanted more money for the wall and has expressed concern the plan is being framed as a defeat for him in the media.
Trump has repeatedly vowed Mexico would pay for the wall, a suggestion that country has spurned. His descriptions of the wall's size have fluctuated, at times saying it would cover 1,000 of the 2,000-mile boundary. Previous administrations constructed over 650 miles of barriers.
Facing opposition from Trump, Democrats lost their bid to include language giving federal contractors back pay for wages lost during the last shutdown. Federal workers have been paid for time they were furloughed or worked without paychecks.
Also omitted was an extension of the Violence Against Women Act. Democrats say this will give them a chance later this year to add protections for transgender people to that law.