WASHINGTON (AP) — President Joe Biden on Saturday hailed Congress’ passage of his $1 trillion infrastructure package as a “monumental step forward for the nation” after fractious fellow Democrats resolved a months-long standoff in their ranks to finally seal the deal.

“Finally, infrastructure week,” a beaming Biden told reporters. “I’m so happy to say that: infrastructure week.”

The House passed the measure 228-206 late Friday, prompting prolonged cheers from the relieved Democratic side of the chamber. Thirteen Republicans, mostly moderates, supported the legislation while six of Democrats’ farthest left members — including Reps. Alexandria Ocasio-Cortez of New York and Cori Bush of Missouri — opposed it.

Approval of the bill, which promises to create legions of jobs and improve broadband, water supplies and other public works, sends it to the desk of a president whose approval ratings have dropped and whose nervous party got a cold shoulder from voters in this past week’s off-year elections.

Democratic candidates for governor were defeated in Virginia and squeaked through in New Jersey, two blue-leaning states. Those setbacks made party leaders — and moderates and liberals alike — impatient to produce impactful legislation and demonstrate they know how to govern. Democrats can ill afford to seem in disarray a year before midterm elections that could result in Republicans regaining congressional control.

The infrastructure package is a historic investment by any measure, one that Biden compares in its breadth to the building of the interstate highway system in the last century or the transcontinental railroad the century before.

“This is a blue collar blueprint to rebuilding America,” he said in his White House remarks.

His reference to infrastructure week was a jab at his predecessor, Donald Trump, whose White House declared several times that “infrastructure week” had arrived, only for nothing to happen.

Simply freeing up the infrastructure measure for final congressional approval was like a burst of adrenaline for Democrats. Yet despite the win, Democrats endured a setback when they postponed a vote on a second, even larger bill until later this month.

That 10-year, $1.85 trillion measure bolstering health, family and climate change programs was sidetracked after moderates demanded a cost estimate on the sprawling measure from the nonpartisan Congressional Budget Office. The postponement dashed hopes that the day would produce a double-barreled win for Biden with passage of both bills.

But in an evening breakthrough brokered by Biden and House leaders, five moderates later agreed to back that bill if the budget office’s estimates are consistent with preliminary numbers that White House and congressional tax analysts have provided. The agreement, in which lawmakers promised to vote on the social and environment bill by the week of Nov. 15, stood as a significant step toward a House vote that could ultimately ship it to the Senate.

“Generations from now, people will look back and know this is when America won the economic competition for the 21st Century,” Biden said in a written statement early Saturday.

The president and first lady Jill Biden delayed plans to travel Friday evening to their house in Rehoboth Beach, Delaware. Instead, Biden spoke to House leaders, moderates and progressives, said a White House official who described the conversations on condition of anonymity.

Rep. Pramila Jayapal, D-Wash., leader of the Congressional Progressive Caucus, said Biden even called her mother in India, though it was unclear why.

“This was not to bribe me, this is when it was all done,” Jayapal told reporters. The lawmaker said her mother told her she “just kept screaming like a little girl.”

In a two-sentence statement, the five moderates said that if the fiscal estimates on the social and environment bill raise problems, “we remain committed to working to resolve any discrepancies” to pass it. The five included Rep. Josh Gottheimer, D-N.J., leader of a group of centrists who this summer repeatedly pressed House Speaker Nancy Pelosi, D-Calif., to schedule earlier votes on the infrastructure bill.

In exchange, liberals agreed to back the infrastructure measure, which they’d spent months holding hostage in an effort to press moderates to back the larger bill.

The day marked a rare detente between Democrats’ moderate and progressive wings that party leaders hope will continue this fall. The rival factions have spent recent weeks accusing each other of jeopardizing Biden’s and the party’s success by overplaying their hands and expressed a deep distrust of each other.

But Friday night, Jayapal suggested they would work together moving forward.

“Let me tell you, we’re going to trust each other because the Democratic Party is together on this,” she said. “We are united that it is important for us to get both bills done.”

The agreement came together after the White House issued a statement from Biden explicitly urging Democrats to support both bills. “I am confident that during the week of November 15, the House will pass the Build Back Better Act,” he said.

When party leaders announced early in the day that the social and environment measure would be delayed, the scrambled plans cast a fresh pall over the party.

Democrats have struggled for months to take advantage of their control of the White House and Congress by advancing their top priorities. That’s been hard, in part because of Democrats’ slender majorities, with bitter internal divisions forcing House leaders to miss several self-imposed deadlines for votes.

“Welcome to my world,” Pelosi told reporters, adding, “We are not a lockstep party.”

Liberals had long demanded that the two massive bills be voted on together to pressure moderates to support the larger, more expansive social measure.

Democrats’ day turned tumultuous early after a half-dozen moderates demanded the budget office’s cost estimate of the sprawling package of health, education, family and climate change initiatives before they would vote for it.

Party leaders said that would take days or more. But with Friday’s delayed vote and lawmakers leaving town for a week’s break, those budget estimates should be ready by the time a vote is held.

The infrastructure measure cleared the Senate in August with bipartisan support. The package would provide huge sums for highway, mass transit, broadband, airport, drinking and waste water, power grids and other projects.

As for the social and environment package, House passage would send it to the Senate, where it faces certain changes and more Democratic drama. That’s chiefly because of demands by Sens. Joe Manchin of West Virginia and Kyrsten Sinema of Arizona to contain the measure’s costs and curb or drop some of its initiatives.

Moderates have forced leaders to slash the roughly 2,100-page measure to about half its original $3.5 trillion size. Republicans oppose it as too expensive and damaging to the economy.

The package would provide large numbers of Americans with assistance to pay for health care, raising children and caring for elderly people at home. The package would provide $555 billion in tax breaks encouraging cleaner energy and electric vehicles. Democrats added provisions in recent days restoring a new paid family leave program and work permits for millions of immigrants.

Much of the package’s cost would be covered with higher taxes on wealthier Americans and large corporations.