CNN  — 

Final passage of a massive public works bill Friday provided President Joe Biden what had increasingly seemed like a vanishing ideal: A major, bipartisan accomplishment that has the power to improve the lives of millions of Americans.

The vote came after weeks of torturous negotiations among Democrats, and is likely to remain the only major piece of legislation Biden passes with help from Republicans ahead of next year’s midterm elections. A second, larger bill that would expand the social safety net and provide historic investments in combating climate change remains undone.

Yet after a string of setbacks and delays – including in the frenzied final hours before the bill passed – Biden emerged having accomplished what many had written off as impossible in a political era marred by dysfunction and mistrust. The bill represents the largest single infrastructure investment in American history.

RELATED: What’s in the bill

“Finally – infrastructure week,” Biden said with a laugh as he strode into the State Dining Room on Saturday morning to trumpet his victory, an unsubtle dig at the futile, Groundhog Day-like efforts to pass a roads-and-bridges improvement during the last administration.

“We did something that’s long overdue, that’s long been talked about in Washington, but never has actually been done,” Biden said.

For the President, the experience has proved both frustrating and illuminating as he discovers just how fractious the current environment really is. People who have spoken to him over the past days describe Biden as focused and jocular – but also confused at Democrats’ seeming inability to strike an agreement on what is ostensibly a widely popular agenda.

As he celebrated the bill’s passage on Saturday morning, Biden acknowledged the fraught conditions in Congress and conceded they would not end with one bipartisan accomplishment.

“I know we’re divided. I know how mean it can get and I know there are extremes on both ends that make it more difficult than it’s been in a long, long time,” he said. “But I’m convinced the American people know that we’re committed to enhancing their ability to make their way and all do better.”

To reinforce that message, Biden and his top Cabinet officials will tour the country in the coming weeks to promote what’s in the infrastructure proposal and how it will help the American people, a White House official said Saturday.

“President Biden will lead that effort for his administration, including through events around the country aimed at touting what we’ve secured for working people with these historic investments,” the official said.

That tour will include visits to “red states, blue states, big cities, small towns, rural areas, Tribal communities and more,” as well as national and regional broadcast and print interviews targeted to African American and Spanish-language media outlets, the official said.

A late-night effort pays off

Until nearly the last minute Friday, it appeared as if internal Democratic divisions would again deprive the President of a bipartisan infrastructure bill to sign into law, despite an intensive, late-night effort from Biden and his aides to finally bring members of his party around.

What ultimately worked was the intensive brokering of an agreement between warring wings of the party, ending a blockade by progressives in exchange for a commitment in writing from moderates to support the larger plan no later than the middle of this month.

“I spent a lot of time, as you probably heard, with a lot of people,” Biden said, describing a carefully honed process built upon developing personal relationships with his interlocutors.

“Everybody at the end of the day, I have to admit, dealt with me fairly,” Biden said. “This is probably more than you need to know, but part of the process is getting to know all the people personally again.”

After dire election results Tuesday caused a flurry of recrimination among Democrats, Friday amounted to a dramatic turnabout of fortunes for a President desperately in need of a win.

“All the talk about the elections and what do they mean – they want us to deliver. They want us to deliver. Democrats, they want us to deliver,” Biden said on Saturday morning. “Last night, we proved we can on one big item. We delivered.”

Sunlight after multiple false dawns

It was not the first time Biden’s party appeared on the cusp of passing the two historic pieces of legislation. Past attempts repeatedly caught in new snags. The President has been described by aides as being in “closing” mode for weeks, even as the talks stretched on.

Throughout the process, Biden had mostly avoided telling Democrats exactly when and how to vote on the pair of sweeping bills that comprise almost the entirety of his domestic agenda.

But on Friday morning, with his party still reeling from dismal election results three days earlier and questions swirling about his ability to deliver on a lofty set of campaign promises, Biden changed course.

For the first time, he told Democrats explicitly it was time to vote “right now” on the two spending bills – a step some of his allies wished he’d taken earlier. Declining to take questions after an appearance in the State Dining Room, he retreated behind closed doors to dial Democrats to get them in line – and to deliver the same message.

“Let’s show the world that America’s democracy can deliver and propel our economy forward and let’s get this done,” he said in the State Dining Room.

In an urgent bout of calls – placed first from the Oval Office, and later from the private third-floor White House residence – Biden on Friday sought to keep a fragile arrangement from collapsing. He scrapped his plans to leave Friday evening for his seaside home in Rehoboth Beach, Delaware, opting to remain at the White House.

He spoke at regular intervals with House Speaker Nancy Pelosi, who spent the evening constantly consulting printed-out lists of members and their positions while communicating with fellow Democrats. White House senior staff remained abreast of who Pelosi was trying to pick off, ready to launch bespoke lobbying efforts from the President if they saw an opening.

“Welcome to my world – this is the Democratic Party,” Pelosi told reporters as the night wore on, alluding to a “Speaker’s secret whip count” as rationale for her optimism.

Biden’s busy night

The President spoke to Rep. Pramila Jayapal, leader of the Congressional Progressive Caucus, to get a read on her position. He didn’t lay out any ultimatums, a person familiar with the call said, but did make clear it was a moment when he needed Democrats to unify.

And he phoned directly into a meeting of the progressives, delivering a lengthy appeal over speakerphone for a vote on the infrastructure bill and providing assurances he would continue the fight for the larger social spending package.

“His message is that he is determined to bring everyone together on something we can all count on, and move forward together on that basis,” said Rep. Jared Huffman, a California Democrat, after emerging from the meeting. “He urged us to work with him in good faith. Not to trust him blindly, but to give him a chance to deliver that deal, frankly, between the two sides who were disagreeing on this.”

At the heart of Biden’s message to progressives was an offer to work with them to extract more concrete assurances from moderates that they would eventually support the social spending plan. A small handful of moderates have said they must first see an official estimate of the plan’s costs before voting on it.

That appeal seemed to break loose support from the progressives.

“We are about to all hold hands and jump together,” one member said emerging from the meeting.

Around 9 p.m. ET, Biden brought the pleas he’d been making in private into public view: “I am urging all members to vote for both the rule for consideration of the Build Back Better Act and final passage of the bipartisan infrastructure bill tonight,” he wrote in a statement released by the White House. “I am confident that during the week of Nov. 15, the House will pass the Build Back Better Act.”

Before long, both sides had released the requisite statements, allowing the process to move ahead. But even as the vote commenced on the House floor, it remained uncertain that every Democrat would back the bill.

Biden and his aides watched from the White House with some trepidation as the voting got underway, but their anxiety eased as 13 Republicans cast votes in favor of the bill, allowing it to pass 228-206.

Aides debated whether to have Biden speak after the bill passed. But 11:30 p.m. ET on a Friday evening was deemed too late, and the White House sent reporters home just before midnight.

A long road to a major win

Biden has spent more time over the past several weeks in talks with lawmakers than on nearly anything else, according to White House officials, who said his efforts to secure agreement among members of his party had largely consumed his private schedule.

“I’ve been doing this thing my whole life,” Biden said on Saturday. “I’ve been able, in the Senate, to put things together when they said they couldn’t be put together, just by making the overwhelming point that you can’t have all you want. It’s a process.”

Until roughly the middle of October, the President spent most of his time listening to Democrats’ concerns and avoiding firm positions either on process or content of the bill, aside from the broad outlines he’d proposed.

That changed as November approached, and with it a pair of high-stakes deadlines: a major climate summit in Glasgow and Virginia’s gubernatorial election, both of which would serve as referendums on Biden’s ability to unite his party and deliver on his lofty promises.

Both came and went without final agreement or passage, a blow to Biden both politically and on the world stage. Arriving in the dark Wednesday morning hours in Washington after a grim flight home from Europe as election returns emerged, Biden was eager for a rebound.

The President’s one-on-one engagement with legislators intensified earlier this week after returning from his trip abroad to find a Democratic Party suddenly shaken and dispirited by election results in Virginia and New Jersey.

On Wednesday, Thursday and Friday, the President devoted hours to holding individual conversations with moderates, who raised concerns about the cost of the Build Back Better agenda, and progressives, who were pushing to restore programs that had been cut from the bill.

Lawmakers who spoke to the President said he had a firm grasp on the nuts and bolts of the proposals and was trying to raise their comfort levels. His approach was less arm-twisting, one Democratic congressman told CNN, and more simply listening and explaining the popularity of the individual programs on education, the environment and more.

Three lawmakers who had such conversations, and spoke to CNN on condition of anonymity, described the President as sharp and focused with a strong sense of humor, even as he recited specific numbers and fine print of the legislation.

Biden comes to grips with a new Washington

In some calls, he waxed nostalgic about more productive times on Capitol Hill, raising genuine questions about the deep divides inside the Democratic Party and the polarization overall that has contributed to the gridlock.

“He is truly disappointed and confused by the divisions,” one congressman said. “He talks about how different Congress is now.”

A senior administration official said the President was trying to build levels of trust between the varying factions inside the party – and with the White House – that have long been frayed, but have recently broken down even more.

One Democratic member of Congress expressed frustration that Biden had yet to give a firm deadline and ask the lawmakers to vote on his agenda. By week’s end, he had done just that, calling on the House to start voting on the bill on Friday.

The shift into closing mode came after weeks of private grumbling from Democrats and other allies of the administration, who voiced dismay that Biden was not more forcefully pressing members of his party into finding an agreement.

White House officials largely wrote off those concerns, suggesting the President’s wait-it-out approach was carefully designed to bring all sides together without throwing the talks into disarray. And they maintained the time would come when Biden would shift into a different gear.

Over the course of months, Biden has welcomed a parade of lawmakers to the Oval Office and his adjacent private dining room as he worked to gather Democratic consensus on his sweeping social safety net package, which had been required to secure passage of a smaller bipartisan infrastructure bill that was negotiated over the summer.

In separate meetings with progressives, moderates and Democratic leaders, Biden sought to act not as mediator and sounding board for the range of viewpoints held by members of his party.

His most consistent message, according to people familiar with the discussions, was warning about the risk of doing nothing.

CNN’s Jeff Zeleny, Phil Mattingly, Manu Raju, Jessica Dean, Annie Grayer, Arlette Saenz and Betsy Klein contributed to this report.