President Biden went to Capitol Hill on Wednesday to rally Senate Democrats around roughly $4 trillion in new, once-in-a-generation economic investments to revitalize U.S. infrastructure, battle climate change and expand health-care benefits and the federal social safety net.

Inside the closed-door lunch — Biden’s first such in-person visit as president — he tapped into his roots, emphasizing the package’s potentially transformational effect on America’s middle class, according to Democrats who were present. Biden mused at one point about how appealing the proposals might have been to his father and asked senators to keep in mind people like his old neighbors in Scranton, Pa., as they consider the legislation.

“This president makes an incredibly compelling case that this is the moment to go big,” said Sen. Chris Murphy (D-Conn.). “This is a moment you have to be able to deliver real money in the pockets of Americans that are hurting.”

Biden’s salesmanship opened a new chapter in a complicated battle over his infrastructure agenda. White House and Democratic leaders are juggling an ideologically diverse caucus that must remain unified to push the massive spending package to Biden’s desk. This comes as senators are working on a separate but related bipartisan infrastructure deal, raising the prospect that Republican votes could peel off from that effort as Democrats push for trillions in new social spending.

On Wednesday, Biden made the pitch for both bills. And after spending nearly an hour with Democratic senators, the president — who served in the Senate for 36 years — told reporters it was “great to be home, great to be back with all my colleagues, and I think we’re going to get a lot done.”

More than a half-dozen Democratic senators spoke during the lunch that had a “pep rally” feel, said one official who spoke on the condition of anonymity to describe a private meeting. Rather than asking questions of Biden, Senate Democrats thanked the president for his ambitious agenda and other members for building the plans on Capitol Hill to execute it. In particular, Sen. Bernie Sanders (I-Vt.) — a rival during the 2020 Democratic presidential primaries — praised Biden for putting forward a plan to help people who need it the most, the official said.

Agreeing on the size of the resolution produced Wednesday’s positive atmosphere, but a long process lies ahead: Many of the party’s most ambitious spending ideas have yet to be translated into actual policies. On thorny issues like health care, immigration, climate change and taxes, the debate easily could take months and antagonize existing political fissures within the Democratic caucus, souring the current mood.

Senators urged their colleagues to keep the momentum in the coming months as lawmakers hash out the details.

“[Biden] essentially said, this is a big moment: We are on the verge of actually delivering meaningful help to hundreds of millions of middle-class Americans,” said Sen. Christopher A. Coons (D-Del.). “He went through a couple of concrete and specific ways it would make a real difference for families.”

Democrats were further animated by the political promise embedded in a set of agenda items supported by a president who has promised to focus on working Americans and make the government responsive to their everyday concerns.

“He understands people who work really hard who don’t get special breaks all the time, and I think that has the potential to be transformational to our politics,” said Sen. Martin Heinrich (D-N.M.). “The Democratic Party is on the cusp of making it clear again why the middle class should support them, because we’re going to do things that they feel, that’s not esoteric.”

Only after Biden left did any Senate Democrat offer critical feedback. That came from Sen. Joe Manchin III (W.Va.), who has not been shy about using his leverage as a moderate from an overwhelmingly Republican state.

Manchin expressed a general willingness to work with his fellow Democrats on the massive bill, and he did not raise concerns with its size and scope, but he shared uneasiness with some of the policies that could be embedded in it — such as an ambitious goal of “decarbonizing” American energy production by eliminating fossil fuel subsidies and encouraging more renewable sources.

“You cannot be moving towards eliminating fossil [fuels] — you should be innovating and using more technology,” said Manchin, who chairs the Senate Energy and Natural Resources Committee. “They know where I stand, and we’re going to sit down and work through it.”

The president’s efforts focus on two separate but intertwined economic packages. The first is the roughly $1 trillion infrastructure deal, which nearly two dozen Senate Democrats and Republicans brokered in principle last month. Lawmakers in the group gathered late Tuesday to continue hashing out several outstanding issues, with the goal of reconciling most of their differences by Thursday and bringing a bill to the Senate floor as soon as next week.

Weeks ago, Democrats embarked on a second effort to try to shepherd the more partisan aspects of Biden’s social agenda into law through a process known as reconciliation. That maneuver allows lawmakers in the Senate to advance budget-related measures through a simple majority, rather than 60 votes.

On the second package, Democrats reached a breakthrough Tuesday after days of late-night discussions, with senators announcing the $3.5 trillion reconciliation blueprint that will include massive new spending for health, education and safety-net programs.

Democrats plan to expand Medicare as part of that effort, funding new dental, vision and hearing benefits, along with changes to federal law that aim to lower the cost of prescription drug prices. And the lawmakers stressed that they hope to pay for it through tax hikes on corporations and wealthy families — a non-starter for Republicans — while ramping up the ability of the government to pursue those who do not pay what they owe.

While GOP senators directly negotiating the infrastructure agreement insist that the two plans are separate endeavors, their leadership noted that the bills’ fates are increasingly tied — and for them, the price tag announced late Tuesday did not help.

“I want to look at the infrastructure bill on its own, but it’s awfully hard when they continue to link them publicly not to view it through that lens,” said Senate Minority Whip John Thune (R-S.D.), the party’s main vote-counter. “I think that complicates passage of the infrastructure bill for a lot of Republicans.”

During a White House discussion later Wednesday with a bipartisan group of mayors and governors, Biden said he believed the infrastructure deal being finalized by Democratic and Republican senators was in “good shape.”

Asked whether he was concerned about having a budget plan supported by only Democrats moving in parallel with a bipartisan infrastructure proposal, Biden said “the only way to get it done is to have two tracks.”

The reconciliation deal is larger than some spending-wary moderate Democrats wanted but smaller than liberals — including Sanders, who had advocated for a $6 trillion package — initially envisioned. But Sanders has mounted a full-throated defense of the scaled-back proposal, saying it could become the most significant spending on government programs since the Great Depression.

The Democrats-only agreement reached Tuesday evening would also extend an expansion of the child tax credit — payments that will begin Thursday for a benefit enacted this year as part of the $1.9 trillion coronavirus relief package. It further aims to include funding for universal prekindergarten for 3- and 4-year-olds, child care programs, paid family and medical leave, and nutrition assistance. And it includes plans to enact a pathway to permanent residency for immigrants who lack legal status, although how that program would be shaped is to be determined.

Sen. Elizabeth Warren (D-Mass.), another liberal leader, called the plan a “strong first step.”

“I’ll be in there fighting to make sure that we have full funding for universal child care and enough money to attack the climate crisis head on and make sure that billionaires and giant corporations pay a fair share and get this thing funded,” she said.

In the House, Speaker Nancy Pelosi (D-Calif.) began rallying her troops around the Senate plan, saying in a letter to Democratic lawmakers that “this budget will make bold, essential investments in our values as a nation.”

Three House Democratic aides to liberal lawmakers said attempts to cut the $3.5 trillion price tag to appease moderates such as Manchin and Sen. Kyrsten Sinema (D-Ariz.) would infuriate their base. Still, some of the aides were surprised that Sanders — who leads the Senate Budget Committee — was able to strike a deal higher than $1 trillion, considering the dynamics in the Senate Democratic caucus.

“I see this as a down payment,” said Rep. Pramila Jayapal (D-Wash.), a leader of liberals in the House. “I think this will be a significant down payment on a real investment into our people, but it’s not the end.”

On the $3.5 trillion package, Manchin said he is waiting to review the details — but stressed that a key decision-making factor for him is whether it is fully paid for. He also warned that raising the corporate tax rate too dramatically from its current level of 21 percent could impede the country’s global competitiveness, and he reiterated Wednesday that a rate of 28 percent — proposed by the White House and supported by most Senate Democrats — “doesn’t make any sense at all.”

Sinema similarly indicated she is waiting on details, according to an aide.

Matt Viser contributed to this report.